/**
 * OTP Modal Styles
 * Fully themed with FluentCommunity CSS variables — zero hardcoded colors.
 * Supports light/dark mode via html.dark (FC's toggle).
 *
 * @package TBC_OTP_Verification
 */

/* ─── Overlay ────────────────────────────────────────────────────────── */

.tbc-otp-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    animation: tbc-otp-fadein 0.2s ease forwards;
}

.tbc-otp-fullpage-overlay {
    position: relative;
    min-height: 100vh;
    background: var(--fcom-secondary-bg, #f0f2f5);
}

@keyframes tbc-otp-fadein {
    to { opacity: 1; }
}

/* ─── Modal Card ─────────────────────────────────────────────────────── */

.tbc-otp-modal {
    background: var(--fcom-primary-bg, #ffffff);
    border: 1px solid var(--fcom-primary-border, #e3e8ee);
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    animation: tbc-otp-slideup 0.25s ease forwards;
}

@keyframes tbc-otp-slideup {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Header ─────────────────────────────────────────────────────────── */

.tbc-otp-modal__header {
    background: var(--fcom-primary-button, #2B2E33);
    color: var(--fcom-primary-button-text, #ffffff);
    padding: 20px 24px;
    text-align: center;
}

.tbc-otp-modal__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: inherit;
}

/* ─── Body ───────────────────────────────────────────────────────────── */

.tbc-otp-modal__body {
    padding: 28px 24px 24px;
}

.tbc-otp-modal__instructions {
    text-align: center;
    color: var(--fcom-secondary-text, #525866);
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 20px;
}

/* ─── Code Input ─────────────────────────────────────────────────────── */

.tbc-otp-modal__input-wrap {
    margin-bottom: 16px;
}

.tbc-otp-modal__input {
    display: block;
    width: 100%;
    padding: 14px 16px;
    font-size: 24px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    letter-spacing: 0.3em;
    text-align: center;
    background: var(--fcom-primary-bg, #ffffff);
    color: var(--fcom-primary-text, #19283a);
    border: 1px solid var(--fcom-primary-border, #e3e8ee);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.tbc-otp-modal__input:focus {
    border-color: var(--el-color-primary, #409eff);
    box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.15);
}

.tbc-otp-modal__input::placeholder {
    color: var(--fcom-secondary-text, #525866);
    opacity: 0.4;
}

/* ─── Status Message ─────────────────────────────────────────────────── */

.tbc-otp-modal__status {
    text-align: center;
    font-size: 13px;
    min-height: 20px;
    margin-bottom: 16px;
    line-height: 1.4;
}

.tbc-otp-modal__status--error {
    color: #f5222d;
}

.tbc-otp-modal__status--success {
    color: #52c41a;
}

.tbc-otp-modal__status--info {
    color: var(--fcom-secondary-text, #525866);
}

/* ─── Buttons ────────────────────────────────────────────────────────── */

.tbc-otp-modal__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.tbc-otp-modal__btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.1s ease;
    line-height: 1.4;
}

.tbc-otp-modal__btn:hover {
    opacity: 0.9;
}

.tbc-otp-modal__btn:active {
    transform: scale(0.98);
}

.tbc-otp-modal__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tbc-otp-modal__btn--primary {
    background: var(--fcom-primary-button, #2B2E33);
    color: var(--fcom-primary-button-text, #ffffff);
}

.tbc-otp-modal__btn--secondary {
    background: var(--fcom-secondary-bg, #f0f2f5);
    color: var(--fcom-primary-text, #19283a);
    border: 1px solid var(--fcom-primary-border, #e3e8ee);
}

/* ─── Links ──────────────────────────────────────────────────────────── */

.tbc-otp-modal__links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.tbc-otp-modal__link {
    font-size: 13px;
    color: var(--fcom-text-link, #409eff);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.tbc-otp-modal__link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.tbc-otp-modal__link--disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ─── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .tbc-otp-modal {
        max-width: calc(100% - 32px);
        border-radius: 10px;
    }

    .tbc-otp-modal__body {
        padding: 24px 16px 20px;
    }

    .tbc-otp-modal__input {
        font-size: 20px;
        padding: 12px 14px;
    }
}
