/* Authentication Modal Styles */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.auth-modal-overlay.active {
    display: flex;
}

.auth-modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-modal-header {
    padding: 24px 24px 0;
    text-align: center;
    position: relative;
}

.auth-modal-logo {
    width: 180px;
    height: auto;
    margin: 0 auto 16px;
    display: block;
}

.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.auth-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.auth-modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px;
}

.auth-modal-subtitle {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.auth-modal-body {
    padding: 24px;
}

.auth-form-group {
    margin-bottom: 20px;
}

.auth-form-label {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
    font-size: 14px;
}

.auth-form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.auth-form-input:focus {
    outline: none;
    border-color: #3FA96E;
}

.auth-form-input.error {
    border-color: #dc3545;
}

.auth-form-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.auth-form-error.show {
    display: block;
}

.auth-btn {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-btn-primary {
    background: #3FA96E;
    color: white;
}

.auth-btn-primary:hover:not(:disabled) {
    background: #2E7A52;
}

.auth-btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #e1e5e9;
}

.auth-btn-secondary:hover:not(:disabled) {
    background: #e9ecef;
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-btn-loading .auth-spinner {
    display: inline-block;
}

.auth-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.otp-input-container {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 20px 0;
}

.otp-digit {
    width: 48px !important;
    height: 48px !important;
    text-align: center !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    border: 2px solid #e1e5e9 !important;
    border-radius: 8px !important;
    transition: border-color 0.2s !important;
    position: relative !important;
    color: #000 !important;
    background: #fff !important;
    z-index: 1 !important;
    padding: 12px 16px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    -moz-appearance: textfield !important;
}

.otp-digit:focus {
    outline: none !important;
    border-color: #3FA96E !important;
    color: #000 !important;
    background: #fff !important;
}

.otp-digit.filled {
    border-color: #3FA96E !important;
    background: #fff !important;
    color: #000 !important;
}

.otp-digit.error {
    border-color: #dc3545 !important;
    color: #000 !important;
}

.otp-digit.show-cursor:empty::after {
    content: '|';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #3FA96E;
    font-weight: normal;
    animation: blink 1s infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

.otp-info {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.otp-info strong {
    color: #333;
}

.resend-container {
    text-align: center;
    margin-top: 16px;
}

.resend-text {
    color: #666;
    font-size: 14px;
}

.resend-btn {
    background: none;
    border: none;
    color: #3FA96E;
    cursor: pointer;
    font-weight: 500;
    text-decoration: underline;
}

.resend-btn:disabled {
    color: #999;
    cursor: not-allowed;
    text-decoration: none;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: #666;
    font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e1e5e9;
}

.auth-divider::before {
    margin-right: 16px;
}

.auth-divider::after {
    margin-left: 16px;
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.google-btn:hover {
    background: #f8f9fa;
    text-decoration: none;
    color: #333;
}

.google-icon {
    width: 20px;
    height: 20px;
}

.success-animation {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
    font-size: 32px;
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.success-message {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-modal {
        width: 95%;
        margin: 20px;
    }
    
    .otp-digit {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .otp-input-container {
        gap: 6px;
    }
}

/* Body scroll lock */
body.modal-open {
    overflow: hidden;
}