/* Prevent body scroll when modal open */
body.opnar-otp-open {
    overflow: hidden;
}

/* Overlay (modal background) */
#opnar-otp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

/* Modal container */
.opnar-otp-modal {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 12px;
    padding: 26px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: opnarFadeIn .2s ease-out;
}

/* Close button */
#opnar-otp-close,
.opnar-otp-close-btn {
    position: absolute;
    right: 16px;
    top: 12px;
    background: transparent;
    border: none;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    color: #777;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 3;
}

#opnar-otp-close:hover,
.opnar-otp-close-btn:hover {
    color: #000;
    background: transparent !important;
}

/* Standalone page wrapper */
.opnar-otp-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, .08);
}

/* Card (standalone fallback mode) */
.opnar-otp-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 12px;
    padding: 28px 24px 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    position: relative;
}

/* Title */
.opnar-otp-title,
.opnar-otp-card h2,
.opnar-otp-modal h2 {
    margin: 0 0 22px;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
}

/* ===== LEGACY TOP SWITCH (safe to keep hidden) ===== */
.opnar-login-switch {
    display: none;
}

.opnar-login-switch-btn {
    flex: 1;
    width: auto !important;
    margin-bottom: 0 !important;
    padding: 11px 12px !important;
    border: 1px solid #ffd2b3 !important;
    background: #fff4eb !important;
    color: #ff6b00 !important;
    font-size: 14px !important;
    font-weight: 600;
    border-radius: 6px !important;
    transition: all .2s ease;
}

.opnar-login-switch-btn:hover {
    background: #ffe7d6 !important;
    color: #e85f00 !important;
}

.opnar-login-switch-btn.active {
    background: #ff6b00 !important;
    color: #fff !important;
    border-color: #ff6b00 !important;
}

/* ===== INPUT STYLE ===== */
.opnar-otp-card input,
.opnar-otp-modal input {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 15px;
    transition: border .2s ease, box-shadow .2s ease;
}

.opnar-otp-card input:focus,
.opnar-otp-modal input:focus {
    outline: none;
    border-color: #ff6b00;
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.08);
}

.opnar-otp-card input::placeholder,
.opnar-otp-modal input::placeholder {
    color: #9a9a9a;
}

/* ===== BUTTON STYLE ===== */
.opnar-otp-card button,
.opnar-otp-modal button {
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: #ff6b00;
    color: #fff;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 500;
    transition: background .2s ease, transform .1s ease;
}

.opnar-otp-card button:hover,
.opnar-otp-modal button:hover {
    background: #e85f00;
}

.opnar-otp-card button:active,
.opnar-otp-modal button:active {
    transform: translateY(1px);
}

/* Secondary button (Resend) */
#opnar-resend-otp {
    background: #f1f1f1 !important;
    color: #333 !important;
}

#opnar-resend-otp:hover {
    background: #e0e0e0 !important;
}

/* ===== BOTTOM SINGLE SWITCH ===== */
.opnar-login-switch-single {
    margin-top: 6px;
    text-align: center;
}

.opnar-login-switch-link {
    width: auto !important;
    display: inline-block !important;
    background: transparent !important;
    border: none !important;
    color: #ff6b00 !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.4;
    cursor: pointer;
    box-shadow: none !important;
    text-decoration: none;
}

.opnar-login-switch-link:hover {
    background: transparent !important;
    color: #e85f00 !important;
    text-decoration: underline;
    transform: none !important;
}

/* ===== MESSAGE ===== */
.opnar-otp-message {
    margin-top: 10px;
    font-size: 14px;
    text-align: center;
}

.opnar-otp-message.error {
    color: #c62828;
}

.opnar-otp-message.success {
    color: #2e7d32;
}

/* Resend */
.opnar-resend-wrap {
    margin-top: 4px;
}

.opnar-resend-countdown {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

/* Email mode wrapper */
.opnar-email-login-wrap {
    margin-top: 2px;
}

/* Animation */
@keyframes opnarFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== MOBILE BOTTOM SHEET STYLE ===== */
@media (max-width: 768px) {
    #opnar-otp-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .opnar-otp-modal,
    .opnar-otp-card {
        width: 100%;
        max-width: 100%;
        height: 75vh;
        border-radius: 20px 20px 0 0;
        padding: 26px 16px 30px;
        overflow-y: auto;
    }

    .opnar-otp-title,
    .opnar-otp-card h2,
    .opnar-otp-modal h2 {
        font-size: 20px;
    }

    #opnar-otp-close,
    .opnar-otp-close-btn {
        right: 14px;
        top: 10px;
        font-size: 28px;
    }

    .opnar-login-switch-single {
        margin-top: 8px;
    }

    .opnar-login-switch-link {
        font-size: 14px !important;
    }
}
