/* ===== RECOVERY FLOW STYLES ===== */

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    gap: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--line);
    color: var(--muted-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 2px solid var(--line);
}

.step-label {
    margin-top: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--muted-ink);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.step.active .step-number {
    background: var(--maroon);
    border-color: var(--maroon);
    color: #fff;
}

.step.active .step-label {
    color: var(--maroon);
}

.step.completed .step-number {
    background: var(--gold);
    border-color: var(--gold);
    color: #fff;
}

.step.completed .step-number::after {
    content: '✓';
    font-size: 0.7rem;
}

.step-connector {
    width: 60px;
    height: 2px;
    background: var(--line);
    margin: 16px 0 0;
    position: relative;
}

.step-connector::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--maroon);
    width: 0%;
    transition: width 0.4s ease;
}

.step.active ~ .step-connector::before,
.step.completed ~ .step-connector::before {
    width: 100%;
}

.recovery-copy {
    margin-bottom: 28px;
    color: var(--muted-ink);
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: center;
}

.step-form {
    animation: contentRise 0.4s ease both;
}

.step-form.hidden {
    display: none;
}

/* Email Confirmation Card */
.email-confirmation-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: linear-gradient(135deg, #fff 0%, #fffaf5 100%);
    border: 1px solid rgba(101, 21, 29, 0.12);
    border-left: 4px solid var(--gold);
    border-radius: 14px;
    margin-bottom: 22px;
    box-shadow: 0 8px 22px rgba(32, 8, 10, 0.1);
}

.card-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: rgba(101, 21, 29, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--maroon);
    flex-shrink: 0;
}

.card-icon-wrapper svg {
    width: 21px;
    height: 21px;
}

/* Named with an "email-" prefix so it cannot inherit the wide padding that
   login.css applies to its own .card-content element. */
.email-card-content {
    flex: 1;
    min-width: 0;
}

.card-message {
    margin: 0 0 7px;
    color: var(--muted-ink);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.4;
}

.masked-email {
    display: block;
    max-width: 100%;
    margin: 0;
    padding: 9px 11px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: 0.015em;
    background: #fff;
    border: 1px solid rgba(101, 21, 29, 0.14);
    border-radius: 9px;
    overflow-wrap: anywhere;
}

.card-hint {
    margin: 8px 0 0;
    color: var(--muted-ink);
    font-size: 0.78rem;
    line-height: 1.4;
}

/* Code Input */
.code-input-wrapper input {
    text-align: center;
    letter-spacing: 6px;
    font-family: 'Monospace', monospace;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Square Code Inputs */
.otp-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 4px 0 6px;
}

.otp-box {
    width: 46px;
    height: 56px;
    padding: 0;
    text-align: center;
    font-family: 'Inter', Tahoma, sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--ink);
    background: #fff;
    border: 1px solid #d9cdc3;
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    -moz-appearance: textfield;
}

.otp-box:focus {
    outline: none;
    border-color: var(--maroon);
    box-shadow: 0 0 0 4px var(--focus);
    transform: translateY(-2px);
}

.otp-box.is-filled {
    border-color: var(--gold);
    background: #fffdf8;
}

.otp-box::-webkit-outer-spin-button,
.otp-box::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.otp-fallback {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    text-align: center;
    letter-spacing: 8px;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ink);
    background: #fff;
    border: 1px solid #d9cdc3;
    border-radius: 9px;
}

/* Input Icon */
.field-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    color: #9a8f8b;
    pointer-events: none;
}

.field-icon svg {
    width: 19px;
    height: 19px;
}

.password-input-wrap input[name="username"] {
    padding-right: 48px;
}

/* Completed Step Connector */
.step-connector.is-complete::before {
    width: 100%;
}

/* Field Hints */
.field-hint {
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--muted-ink);
}

.field-hint.match-success {
    color: #15803d;
}

.field-hint.match-error {
    color: #b91c1c;
}

/* Password Strength */
.password-strength {
    margin-top: 10px;
}

.strength-bar {
    height: 4px;
    background: var(--line);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-fill.strength-weak { background: #ef4444; }
.strength-fill.strength-fair { background: #f97316; }
.strength-fill.strength-good { background: #eab308; }
.strength-fill.strength-strong { background: #22c55e; }

.strength-text {
    font-size: 0.75rem;
    color: var(--muted-ink);
}

/* Resend Code */
.resend-code {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    text-align: center;
}

.resend-code p {
    margin: 0;
    color: var(--muted-ink);
    font-size: 0.88rem;
}

.resend-code a {
    color: var(--maroon);
    font-weight: 600;
    text-decoration: none;
}

.resend-code a:hover {
    text-decoration: underline;
}

/* Recovery Footer */
.recovery-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    text-align: center;
}

.recovery-footer .back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted-ink);
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.recovery-footer .back-link:hover {
    color: var(--maroon);
}

.recovery-footer .back-link svg {
    flex-shrink: 0;
}

/* Button Loader */
.btn-loader {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-primary .btn-text.hidden {
    display: none;
}

.btn-primary .btn-loader.hidden {
    display: none;
}

.btn-primary.is-submitting .btn-text {
    display: none;
}

.btn-primary.is-submitting .btn-loader {
    display: inline-block;
}

/* Form Section submitting state */
.form-section.is-submitting .btn-primary {
    color: transparent;
    pointer-events: none;
}

/* Mobile adjustments */
@media (max-width: 520px) {
    .step-indicator {
        margin-bottom: 24px;
    }

    .step-label {
        font-size: 0.6rem;
    }

    .step-number {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }

    .step-connector {
        width: 36px;
    }

    .email-confirmation-card {
        padding: 13px;
        gap: 11px;
    }

    .card-icon-wrapper {
        width: 38px;
        height: 38px;
        border-radius: 11px;
    }

    .card-icon-wrapper svg {
        width: 18px;
        height: 18px;
    }

    .masked-email {
        font-size: 0.78rem;
        padding: 8px 9px;
    }
}