/* ============================================
   Authentication Security Styles
   ============================================ */

/* Security Messages */
.auth-message {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    animation: slideDown 0.3s ease;
}

.auth-message-info {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    color: #1565c0;
}

.auth-message-success {
    background: #e8f5e8;
    border: 1px solid #c8e6c9;
    color: #2e7d32;
}

.auth-message-warning {
    background: #fff3e0;
    border: 1px solid #ffcc02;
    color: #f57c00;
}

.auth-message-error {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    color: #c62828;
}

.auth-message-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.auth-message-close:hover {
    opacity: 1;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 8px;
    font-size: 12px;
}

.strength-bar {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-bottom: 4px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.password-strength.weak .strength-fill {
    background: linear-gradient(90deg, #f44336, #ff9800);
    width: 33%;
}

.password-strength.medium .strength-fill {
    background: linear-gradient(90deg, #ff9800, #ffeb3b);
    width: 66%;
}

.password-strength.strong .strength-fill {
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    width: 100%;
}

.strength-text {
    font-weight: 600;
    margin-bottom: 2px;
}

.password-strength.weak .strength-text {
    color: #f44336;
}

.password-strength.medium .strength-text {
    color: #ff9800;
}

.password-strength.strong .strength-text {
    color: #4caf50;
}

.strength-feedback {
    color: #666;
    font-size: 11px;
}

/* Security Badges */
.auth-security-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    font-size: 11px;
    color: #0284c7;
    margin-top: 8px;
}

.auth-security-badge svg {
    width: 12px;
    height: 12px;
}

/* Form Security States */
.auth-form.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.auth-form.loading .auth-submit {
    position: relative;
    color: transparent;
}

.auth-form.loading .auth-submit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Input Validation States */
.auth-input.valid {
    border-color: #4caf50;
    background: #f1f8e9;
}

.auth-input.invalid {
    border-color: #f44336;
    background: #ffebee;
}

.auth-input:focus.valid {
    border-color: #4caf50;
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
}

.auth-input:focus.invalid {
    border-color: #f44336;
    box-shadow: 0 0 0 4px rgba(244, 67, 54, 0.1);
}

/* Security Indicators */
.auth-input-wrapper {
    position: relative;
}

.auth-security-indicator {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.auth-security-indicator:hover {
    opacity: 1;
}

.auth-security-indicator.success {
    color: #4caf50;
}

.auth-security-indicator.error {
    color: #f44336;
}

.auth-security-indicator.warning {
    color: #ff9800;
}

/* Rate Limiting Display */
.auth-rate-limit {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-rate-limit svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.auth-rate-limit-timer {
    font-weight: 600;
    margin-left: auto;
}

/* Bot Protection */
.auth-captcha-container {
    margin: 20px 0;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.auth-captcha-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.auth-captcha-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.auth-captcha-input:focus {
    outline: none;
    border-color: #DC4D28;
}

/* Session Security */
.auth-session-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-session-warning svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.auth-session-timer {
    font-family: monospace;
    font-size: 16px;
    font-weight: 600;
    margin-left: auto;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.auth-security-checking {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Security Info Panel */
.auth-security-info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
}

.auth-security-info h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #0284c7;
    display: flex;
    align-items: center;
    gap: 6px;
}

.auth-security-info ul {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: #0c4a6e;
}

.auth-security-info li {
    margin-bottom: 4px;
}

/* Responsive Design */
@media (max-width: 640px) {
    .auth-message {
        font-size: 13px;
        padding: 10px 12px;
    }

    .auth-rate-limit,
    .auth-session-warning {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .auth-rate-limit-timer,
    .auth-session-timer {
        margin-left: 0;
        font-size: 18px;
    }

    .auth-captcha-container {
        padding: 12px;
    }

    .auth-security-info {
        padding: 12px;
    }
}