:root {
    --ripples-primary-async-color: #000000;
    --ripples-secondary-async-color: #10b981;
    --ripples-text-primary: #111827;
    --ripples-text-secondary: #6b7280;
    --ripples-bg-light: #f9fafb;
    --ripples-border: #e5e7eb;
    --ripples-success: #10b981;
    --ripples-error: #ef4444;
    --ripples-overlay: rgba(17, 24, 39, 0.75);
}

#async-login * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

#async-login {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#async-login .login-popup-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    background: var(--ripples-overlay);
    backdrop-filter: blur(8px);
        z-index: 1000000;
        align-items: center;
        justify-content: center;
    animation: fadeIn 0.2s ease-out;
    }

#async-login .login-popup {
        background: white;
    border-radius: 16px;
    padding: 32px;
        width: 90%;
    max-width: 420px;
        position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
                0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

#async-login .close-button {
        position: absolute;
    top: 16px;
    right: 16px;
    background: var(--ripples-bg-light);
        border: none;
        font-size: 24px;
        cursor: pointer;
    color: var(--ripples-text-secondary);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 300;
}

#async-login .close-button:hover {
    background: var(--ripples-border);
    color: var(--ripples-text-primary);
    transform: scale(1.05);
}

#async-login .login-content {
        text-align: center;
    }

#async-login .login-step {
        display: none;
    }

#async-login .login-step.active {
        display: block;
        animation: fadeIn 0.3s ease-out;
    }

#async-login .login-content h2 {
    margin: 0 0 8px 0;
    color: var(--ripples-text-primary);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

#async-login .login-content p {
    color: var(--ripples-text-secondary);
    margin: 0 0 24px 0;
    font-size: 14px;
    line-height: 1.5;
}

#async-login .enter-mail-text {
    margin-bottom: 20px;
}

/* Login Views */
#async-login #phoneLoginView,
#async-login #emailLoginView {
    animation: fadeIn 0.3s ease-out;
}

/* Login Divider */
#async-login .login-divider {
        display: flex;
        align-items: center;
    margin: 20px 0;
    color: var(--ripples-text-secondary);
    font-size: 13px;
    font-weight: 500;
}

#async-login .login-divider::before,
#async-login .login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--ripples-border);
}

#async-login .login-divider span {
    padding: 0 16px;
}

/* Switch Login Method Button */
#async-login .switch-login-method {
    width: 100%;
    padding: 12px 24px;
    background: transparent;
    color: var(--ripples-text-secondary);
    border: 1.5px solid var(--ripples-border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
        cursor: pointer;
    transition: all 0.2s ease;
}

#async-login .switch-login-method:hover {
    background: var(--ripples-bg-light);
    color: var(--ripples-text-primary);
    border-color: var(--ripples-text-secondary);
}

/* Form Inputs */
#async-login .form-group {
    margin-bottom: 20px;
}

#async-login .form-group input {
    width: 100%;
    padding: 14px 12px;
    border: 1.5px solid var(--ripples-border);
    border-radius: 10px;
    flex:1;
    font-size: 15px;
    transition: all 0.2s ease;
    color: var(--ripples-text-primary);
    background: white;
}

#async-login .form-group input::placeholder {
    color: #9ca3af;
}

#async-login .form-group input:focus {
        border-color: var(--ripples-primary-async-color);
        outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
    }

/* Phone Input Group */
#async-login .phone-input-group {
        display: flex;
    gap: 10px;
    align-items: stretch;
    width: 100%;
    margin-bottom: 16px;
}

#async-login .async-login-country-code {
    flex-shrink: 0;
    width: 85px;
    padding: 14px 10px;
    border: 1.5px solid var(--ripples-border);
    border-radius: 10px;
    font-size: 15px;
        background: white;
    transition: all 0.2s ease;
        text-align: center;
    font-weight: 600;
    color: var(--ripples-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

#async-login .async-login-country-code:focus {
        border-color: var(--ripples-primary-async-color);
        outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
    }

#async-login .async-login-country-code::placeholder {
    color: #9ca3af;
        font-weight: normal;
    }

#async-login #async-login-phone {
    flex: 10;
    padding: 14px 16px;
    border: 1.5px solid var(--ripples-border);
    border-radius: 10px;
    font-size: 15px;
    background: white;
    transition: all 0.2s ease;
    color: var(--ripples-text-primary);
    min-width: 0; /* Prevent flex item from overflowing */
}

#async-login #async-login-phone:focus {
    border-color: var(--ripples-primary-async-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

#async-login #async-login-phone::placeholder {
    color: #9ca3af;
}

/* Input Validation States */
#async-login .form-group input.valid {
    border-color: var(--ripples-success);
        background: #f0fdf4;
    }

#async-login .form-group input.invalid {
    border-color: var(--ripples-error);
        background: #fef2f2;
    }

/* Email Display */
#async-login .email-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: var(--ripples-bg-light);
    border-radius: 10px;
    border: 1px solid var(--ripples-border);
}

#async-login .email-text {
    color: var(--ripples-text-primary);
    font-weight: 600;
    font-size: 15px;
}

#async-login .edit-email-button {
    background: none;
    border: none;
    color: var(--ripples-primary-async-color);
    cursor: pointer;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease;
}

#async-login .edit-email-button:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* OTP Inputs */
#async-login .otp-inputs {
        display: flex;
    gap: 12px;
        justify-content: center;
    margin: 24px 0;
}

#async-login .otp-inputs input {
    width: 52px;
    height: 56px;
        text-align: center;
    font-size: 20px;
    font-weight: 600;
    border: 1.5px solid var(--ripples-border);
    border-radius: 10px;
    transition: all 0.2s ease;
    color: var(--ripples-text-primary);
    background: white;
}

#async-login .otp-inputs input:focus {
        border-color: var(--ripples-primary-async-color);
        outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

/* Send OTP Button */
#async-login .send-otp-button {
    width: 100%;
    padding: 14px 24px;
    background: var(--ripples-primary-async-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 
                0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: relative;
}

#async-login .send-otp-button:hover:not(:disabled) {
    background: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 
                0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

#async-login .send-otp-button:active:not(:disabled) {
    transform: translateY(0);
}

#async-login .send-otp-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    opacity: 0.8;
}

/* WhatsApp Icon in OTP Step */
#async-login .async-login-whatsapp-icon {
    display: inline-flex;
        align-items: center;
        justify-content: center;
    gap: 6px;
    vertical-align: middle;
}

#async-login .async-login-whatsapp-icon img {
    vertical-align: middle;
}

/* Success Modal */
#async-login .success-modal {
        text-align: center;
    padding: 20px 0;
}

#async-login .success-animation {
    width: 88px;
    height: 88px;
        margin: 20px auto;
        border-radius: 50%;
    background: var(--ripples-success);
        position: relative;
    animation: scaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        display: flex;
        align-items: center;
        justify-content: center;
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.2);
}

#async-login .checkmark {
    width: 44px;
    height: 44px;
        position: relative;
    }

#async-login .checkmark::after {
        content: "";
        position: absolute;
    top: 50%;
    left: 20%;
    width: 30px;
    height: 16px;
        border: 4px solid white;
        border-top: 0;
        border-left: 0;
    transform: translateY(-60%) rotate(45deg);
        animation: checkmark 0.4s ease-in-out 0.2s forwards;
        opacity: 0;
    }

#async-login .success-message {
    margin-top: 24px;
        animation: fadeInUp 0.5s ease-out 0.3s both;
    }

#async-login .success-message h2 {
    color: var(--ripples-text-primary);
    margin-bottom: 8px;
    font-size: 22px;
    font-weight: 700;
}

#async-login .success-message p {
    color: var(--ripples-text-secondary);
    font-size: 15px;
    line-height: 1.6;
}

/* Resend Container */
#async-login .resend-container {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    margin-top: 16px;
    }

#async-login .resend-link {
        color: var(--ripples-primary-async-color);
        text-decoration: none;
        font-size: 14px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

#async-login .resend-link.disabled {
    color: #9ca3af;
        cursor: not-allowed;
    opacity: 0.6;
    }

#async-login .resend-link:not(.disabled):hover {
    background: rgba(0, 0, 0, 0.05);
    }

#async-login .timer {
        font-size: 14px;
    color: var(--ripples-text-secondary);
    font-weight: 500;
}

/* Error Message */
#async-login #async-login-error-message {
    color: var(--ripples-error);
    padding: 12px 16px;
    margin: 12px 0 0 0;
    font-size: 13px;
    font-weight: 500;
    background: #fef2f2;
    border-radius: 8px;
    border: 1px solid #fecaca;
    animation: shake 0.3s ease;
}

#async-login #async-login-error-message:empty {
    display: none;
}

/* Email Input */
#async-login #async-login-email {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 16px;
}

#async-login #emailLoginView #async-login-email {
    display: block !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(40px) scale(0.95);
            opacity: 0;
        }
    to {
        transform: translateY(0) scale(1);
            opacity: 1;
        }
    }

    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

@keyframes scaleIn {
        from {
        transform: scale(0);
            opacity: 0;
        }
        to {
        transform: scale(1);
            opacity: 1;
        }
    }

@keyframes checkmark {
    0% {
            opacity: 0;
        transform: translateY(-60%) rotate(45deg) scale(0.5);
        }
    100% {
            opacity: 1;
        transform: translateY(-60%) rotate(45deg) scale(1);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-8px);
    }
    75% {
        transform: translateX(8px);
    }
}

/* Mobile Responsive */
    @media (max-width: 480px) {
    #async-login .login-popup {
        padding: 24px 20px;
        width: 95%;
        border-radius: 20px;
    }

    #async-login .login-content h2 {
        font-size: 24px;
    }

    #async-login .otp-inputs {
        gap: 8px;
    }

    #async-login .otp-inputs input {
        width: 48px;
        height: 52px;
        font-size: 18px;
    }

    #async-login .phone-input-group {
        gap: 8px;
    }

    #async-login .async-login-country-code {
        width: 75px;
        font-size: 14px;
        padding: 14px 8px;
    }

    #async-login #async-login-phone {
        font-size: 14px;
        padding: 14px 12px;
    }

    #async-login .send-otp-button {
        font-size: 15px;
        padding: 13px 20px;
    }

    #async-login .switch-login-method {
        font-size: 13px;
        padding: 11px 20px;
    }
}

@media (max-width: 360px) {
    #async-login .otp-inputs input {
        width: 44px;
        height: 48px;
        font-size: 16px;
    }

    #async-login .phone-input-group {
        gap: 6px;
    }

    #async-login .async-login-country-code {
        width: 68px;
        font-size: 13px;
        padding: 14px 6px;
    }

    #async-login #async-login-phone {
        font-size: 13px;
        padding: 14px 10px;
    }
}

/* Focus Visible for Accessibility */
#async-login button:focus-visible,
#async-login input:focus-visible {
    outline: 2px solid var(--ripples-primary-async-color);
    outline-offset: 2px;
}

/* Loading State */
#async-login .send-otp-button:disabled {
    position: relative;
    color: transparent;
}

#async-login .send-otp-button:disabled::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* OTP Title Icons */
#async-login #verify-otp-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#async-login #verify-otp-subTitle {
    font-size: 14px;
    margin-bottom: 20px;
}
