/*
 * Account verification and recovery cards: signup email check, mobile check,
 * forgot password, the reset code and the new-password page. Loaded by
 * partials/verification_code.blade.php, and directly by the two password
 * pages that have no code boxes. Bump the ?v= on all three links together.
 * Colours come from design-tokens.css / color.php (core/DESIGN.md).
 */

/* ---------- Page + card ---------- */
.ev-wrap {
    min-height: 62vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.ev-card {
    width: 100%;
    max-width: 440px;
    background: var(--tp-canvas, #fff);
    border: 1px solid var(--tp-hairline, #E3E8EE);
    border-radius: var(--tp-radius-card, 12px);
    padding: 40px 36px 32px;
    text-align: center;
    box-shadow: var(--tp-shadow-lg, 0 20px 60px rgba(46, 32, 102, .16));
}

.ev-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: var(--tp-primary, #5741E1);
    background: var(--tp-primary-subtle, #E4E0FB);
    box-shadow: 0 0 0 8px var(--tp-50, #F1EFFD);
}

.ev-title {
    font-size: 26px;
    font-weight: 300;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--tp-ink, #0D253D);
    margin: 0 0 10px;
}

.ev-sub {
    color: var(--tp-ink-mute, #64748D);
    font-size: 14.5px;
    line-height: 1.6;
    margin: 0 0 28px;
}

.ev-mail {
    display: block;
    margin-top: 2px;
    font-weight: 600;
    color: var(--tp-ink, #0D253D);
    word-break: break-all;
}

.ev-error {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #E11D48;
}

/* ---------- Buttons ---------- */
.ev-btn {
    width: 100%;
    margin-top: 22px;
    padding: 13px 18px;
    border: 0;
    border-radius: var(--tp-radius-pill, 9999px);
    font-size: 15px;
    font-weight: 600;
    color: var(--tp-on-brand, #fff);
    background: var(--tp-primary, #5741E1);
    box-shadow: 0 8px 20px rgba(87, 65, 225, .28);
    cursor: pointer;
    transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}

.ev-btn:hover {
    background: var(--tp-primary-deep, #4633B8);
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(87, 65, 225, .34);
}

.ev-btn:active {
    background: var(--tp-primary-press, #36288E);
    transform: none;
}

.ev-btn:disabled {
    cursor: progress;
    opacity: .85;
    transform: none;
}

.ev-btn-alt {
    background: var(--tp-ink, #0D253D);
    box-shadow: 0 8px 20px rgba(13, 37, 61, .2);
}

.ev-btn-alt:hover {
    background: var(--tp-ink-secondary, #273951);
    box-shadow: 0 12px 26px rgba(13, 37, 61, .26);
}

.ev-ghost {
    width: 100%;
    padding: 11px 16px;
    border: 1px solid var(--tp-hairline, #E3E8EE);
    border-radius: var(--tp-radius-pill, 9999px);
    background: var(--tp-canvas, #fff);
    font-size: 14px;
    font-weight: 600;
    color: var(--tp-ink-secondary, #273951);
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.ev-ghost:hover {
    background: var(--tp-canvas-soft, #F5F8FE);
    border-color: var(--tp-hairline-input, #C9D6E8);
}

/* ---------- Footer links ---------- */
.ev-resend {
    margin-top: 20px;
    font-size: 13.5px;
    color: var(--tp-ink-mute, #64748D);
    line-height: 1.6;
}

.ev-resend b {
    font-variant-numeric: tabular-nums;
    color: var(--tp-ink, #0D253D);
}

.ev-link {
    color: var(--tp-primary, #5741E1);
    font-weight: 600;
    text-decoration: none;
}

.ev-link:hover {
    color: var(--tp-primary-deep, #4633B8);
    text-decoration: underline;
}

.ev-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 24px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--tp-canvas-soft, #F5F8FE);
    border: 1px solid var(--tp-hairline, #E3E8EE);
    text-align: left;
    font-size: 13px;
    line-height: 1.55;
    color: var(--tp-ink-mute, #64748D);
}

.ev-note i {
    font-size: 18px;
    line-height: 1.2;
    color: var(--tp-primary, #5741E1);
}

.ev-divider {
    position: relative;
    margin: 26px 0 18px;
}

.ev-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--tp-hairline, #E3E8EE);
}

.ev-divider span {
    position: relative;
    padding: 0 12px;
    background: var(--tp-canvas, #fff);
    font-size: 11.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--tp-ink-mute, #64748D);
}

.ev-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--tp-ink-mute, #64748D);
    text-decoration: none;
}

.ev-back:hover {
    color: var(--tp-ink, #0D253D);
}

/* ---------- Change-email form (signup check) ---------- */
.ev-change {
    margin-top: 16px;
    text-align: left;
}

.ev-hidden {
    display: none;
}

.ev-field {
    margin-bottom: 14px;
}

.ev-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--tp-ink-secondary, #273951);
}

.ev-field input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--tp-hairline-input, #C9D6E8);
    border-radius: var(--tp-radius-input, 6px);
    font-size: 16px;
    color: var(--tp-ink, #0D253D);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.ev-field input:focus {
    border-color: var(--tp-primary, #5741E1);
    box-shadow: 0 0 0 .2rem rgba(87, 65, 225, .15);
}

/* ---------- Plain forms (forgot / new password) ---------- */
.ev-form {
    text-align: left;
}

.ev-form .ev-btn {
    margin-top: 10px;
}

.ev-pass {
    position: relative;
}

.ev-pass input {
    padding-right: 48px;
}

.ev-eye {
    position: absolute;
    top: 50%;
    right: 6px;
    width: 36px;
    height: 36px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    font-size: 18px;
    color: var(--tp-ink-mute, #64748D);
    cursor: pointer;
}

.ev-eye:hover {
    color: var(--tp-ink, #0D253D);
    background: var(--tp-canvas-soft, #F5F8FE);
}

.ev-hint {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--tp-ink-mute, #64748D);
}

/* ---------- The six code boxes ---------- */
.otp {
    text-align: left;
}

.otp-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--tp-ink-secondary, #273951);
}

.otp-field {
    position: relative;
}

/* The real input covers the boxes but is invisible; taps anywhere focus it. */
.otp-input {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    font-size: 16px; /* keeps iOS from zooming on focus */
    opacity: 0;
    cursor: text;
}

.otp-boxes {
    display: flex;
    align-items: center;
    gap: 8px;
}

.otp-box {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--tp-hairline-input, #C9D6E8);
    border-radius: 10px;
    background: var(--tp-canvas, #fff);
    font-size: 24px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--tp-ink, #0D253D);
    transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}

.otp-box.is-filled {
    border-color: var(--tp-ink-mute, #64748D);
    background: var(--tp-canvas-soft, #F5F8FE);
}

.otp-box.is-active {
    border-color: var(--tp-primary, #5741E1);
    background: var(--tp-canvas, #fff);
    box-shadow: 0 0 0 .2rem rgba(87, 65, 225, .15);
}

/* Blinking caret in the box waiting for the next digit. */
.otp-box.is-active:not(.is-filled)::after {
    content: '';
    width: 2px;
    height: 24px;
    border-radius: 2px;
    background: var(--tp-primary, #5741E1);
    animation: otp-caret 1s steps(1) infinite;
}

.otp-sep {
    flex: 0 0 10px;
    height: 2px;
    border-radius: 2px;
    background: var(--tp-hairline-input, #C9D6E8);
}

.otp-field.is-invalid .otp-box {
    border-color: #E11D48;
}

.otp-field.is-invalid .otp-boxes {
    animation: otp-shake .35s ease;
}

@keyframes otp-caret {
    50% { opacity: 0; }
}

@keyframes otp-shake {
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

@media (prefers-reduced-motion: reduce) {
    .otp-box.is-active:not(.is-filled)::after,
    .otp-field.is-invalid .otp-boxes {
        animation: none;
    }
}

@media (max-width: 480px) {
    .ev-wrap {
        padding: 16px 0 32px;
        min-height: 0;
    }

    .ev-card {
        padding: 30px 20px 24px;
    }

    .ev-title {
        font-size: 23px;
    }

    .otp-boxes {
        gap: 6px;
    }

    .otp-box {
        height: 50px;
        font-size: 21px;
        border-radius: 8px;
    }

    .otp-sep {
        flex-basis: 6px;
    }
}
