/* ============================================================
   V2 OTP Popup — Figma 1288:84410 / 1288:84482 / 1288:84510
   ============================================================ */

.v2-otp-overlay {
    position: fixed;
    inset: 0;
    /* Must sit above the public-flow's section sticky headers (10000+),
       signature/assignee/success overlays (100000–200100), and any toast
       backdrops, so a wrong-OTP retry or a "captcha-expired" toast in the
       background doesn't dim the popup. Aligned with the AI-assistant
       modal-of-modals tier already used in the V2 stack. */
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 18, 35, 0.55);
    overflow: auto;
    padding: 16px;
    box-sizing: border-box;
}

.v2-otp-modal {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    box-shadow: 0 20px 24px -4px rgba(16, 24, 40, 0.08), 0 8px 8px -4px rgba(16, 24, 40, 0.03);
    box-sizing: border-box;
}

/* ---------- Content section ---------- */
.v2-otp-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
}

.v2-otp-header {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.v2-otp-text-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.v2-otp-title {
    color: #1F1F1F;
    font-family: 'Lato', sans-serif;
    font-size: 18px;
    font-weight: 500;
    line-height: 28px;
    letter-spacing: 0;
    width: 100%;
}

.v2-otp-subtitle {
    color: #7A7A7A;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: 0;
    width: 100%;
    word-break: break-word;
}

.v2-otp-close {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    color: #7A7A7A;
}

.v2-otp-close:hover {
    background: #F2F2F2;
}

/* ---------- Input field block ---------- */
.v2-otp-input-block {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.v2-otp-boxes {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
}

.v2-otp-box {
    width: 48px;
    height: 52px;
    box-sizing: border-box;
    border: 1px solid #D6D6D6;
    background: #FFFFFF;
    border-radius: 8px;
    text-align: center;
    color: #1F1F1F;
    font-family: 'Lato', sans-serif;
    font-size: 18px;
    font-weight: 500;
    line-height: 28px;
    padding: 0;
    margin: 0;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.v2-otp-box:focus {
    border-color: #F0749E;
    box-shadow: 0 0 0 4px #F4EBFF, 0 1px 2px rgba(16, 24, 40, 0.05);
}

.v2-otp-box--error,
.v2-otp-box--error:focus {
    border-color: #DC1759;
    box-shadow: 0 0 0 4px #FCE7F3, 0 1px 2px rgba(16, 24, 40, 0.05);
}

.v2-otp-box:disabled,
.v2-otp-box[disabled] {
    background: #FAFAFA;
    border-color: #D6D6D6;
    box-shadow: none;
    cursor: not-allowed;
    color: #ADADAD;
}

/* ---------- Resend OTP ---------- */
.v2-otp-resend {
    width: 100%;
    text-align: left;
    font-family: 'Lato', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: -0.12px;
    user-select: none;
}

.v2-otp-resend--active {
    cursor: pointer;
}

.v2-otp-resend--active .v2-otp-resend-text--active {
    color: #DC1759;
    text-decoration: underline;
    text-decoration-skip-ink: none;
}

.v2-otp-resend--timer {
    cursor: default;
}

.v2-otp-resend--timer .v2-otp-resend-text--timer {
    color: #7A7A7A;
}

.v2-otp-resend--timer .v2-otp-resend-counter {
    color: #DC1759;
}

.v2-otp-resend--disabled {
    color: #7A7A7A;
    cursor: default;
}

/* ---------- Bottom (actions + toast) ---------- */
.v2-otp-bottom {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.v2-otp-actions {
    width: 100%;
    display: flex;
    align-items: stretch;
}

.v2-otp-submit-btn {
    flex: 1;
    background: #4F66E4;
    border: 1px solid #4F66E4;
    color: #FFFFFF;
    border-radius: 4px;
    padding: 8px 18px;
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    margin: 0;
    min-height: 40px;
}

.v2-otp-submit-btn:hover:not(:disabled):not(.v2-otp-submit-btn--disabled) {
    background: #3D52C6;
    border-color: #3D52C6;
}

.v2-otp-submit-btn:disabled,
.v2-otp-submit-btn--disabled {
    background: #CED4F7;
    border-color: #CED4F7;
    cursor: not-allowed;
    color: #FFFFFF;
}

/* ---------- Toast (state 3) ---------- */
.v2-otp-toast {
    width: 100%;
    background: #FFFCF5;
    border: 1px solid #FEDF89;
    border-radius: 4px;
    padding: 8px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    box-sizing: border-box;
}

.v2-otp-toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 12px;
    background: #FEF0C7;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.v2-otp-toast-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
}

.v2-otp-toast-title {
    color: #1F1F1F;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.v2-otp-toast-body {
    color: #5C5C5C;
    font-family: 'Lato', sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.v2-otp-toast-strong {
    color: #B54708;
    font-weight: 500;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .v2-otp-modal {
        padding: 16px;
        gap: 24px;
    }

    .v2-otp-boxes {
        gap: 8px;
        justify-content: space-between;
    }

    .v2-otp-box {
        width: 44px;
        height: 48px;
        font-size: 16px;
    }
}
