/* OTP Magic Login - Styles */

#otp-magic-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: otp-fade-in 0.2s ease;
}

@keyframes otp-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

#otp-magic-modal {
    background: #fff;
    border-radius: 20px;
    padding: 40px 36px;
    width: 100%;
    max-width: 380px;
    position: relative;
    box-shadow: 0 24px 60px rgba(0,0,0,0.2);
    animation: otp-slide-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

@keyframes otp-slide-up {
    from { transform: translateY(40px) scale(0.95); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

#otp-magic-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s;
}
#otp-magic-close:hover { color: #333; }

.otp-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: otp-bounce 0.5s ease;
}

@keyframes otp-bounce {
    0%   { transform: scale(0.5); opacity: 0; }
    70%  { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

#otp-magic-modal h2 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
}

#otp-magic-modal p {
    margin: 0 0 20px;
    color: #666;
    font-size: 14px;
}

#otp-email-input {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    color: #1a1a2e;
}

#otp-email-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79,70,229,0.1);
}

#otp-send-btn,
#otp-verify-btn {
    width: 100%;
    margin-top: 14px;
    padding: 14px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    letter-spacing: 0.3px;
}

#otp-send-btn:hover,
#otp-verify-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79,70,229,0.35);
}

#otp-send-btn:active,
#otp-verify-btn:active {
    transform: translateY(0);
}

#otp-send-btn:disabled,
#otp-verify-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* OTP Boxes */
#otp-boxes {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 8px 0 4px;
}

.otp-box {
    width: 46px;
    height: 54px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
    caret-color: #4f46e5;
}

.otp-box:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
    transform: scale(1.05);
}

.otp-box.filled {
    border-color: #4f46e5;
    background: #f0f0ff;
}

/* Messages */
.otp-msg {
    margin-top: 12px;
    font-size: 13px;
    min-height: 18px;
    font-weight: 500;
}
.otp-msg.success { color: #16a34a; }
.otp-msg.error   { color: #dc2626; }

/* Resend link */
#otp-resend {
    display: inline-block;
    margin-top: 16px;
    font-size: 13px;
    color: #4f46e5;
    text-decoration: none;
}
#otp-resend:hover { text-decoration: underline; }

/* Loader */
.otp-loader {
    width: 36px;
    height: 36px;
    border: 3px solid #e5e7eb;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: otp-spin 0.7s linear infinite;
    margin: 16px auto 0;
}

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

/* Mobile */
@media (max-width: 440px) {
    #otp-magic-modal {
        margin: 16px;
        padding: 32px 24px;
    }
    .otp-box {
        width: 40px;
        height: 48px;
        font-size: 20px;
    }
    #otp-boxes { gap: 7px; }
}
