/* ─────────────────────────────────────────────────────────────────────
   Delete-account flow styles (extends base.css)

   Single-page multi-step UX: the three panels stack inside one card,
   and JS toggles `data-step="..."` on the root to reveal the active
   one with a slide+fade transition.
   ───────────────────────────────────────────────────────────────────── */

.flow-wrap {
    max-width: 560px;
    margin: 60px auto 0;
    padding: 0 24px;
}

/* stepper rail */
.stepper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 28px;
    font-size: 0.78rem;
    color: var(--text-dim);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.stepper__dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    color: var(--text-mute);
    display: grid;
    place-items: center;
    font-weight: 600;
    transition: background var(--t-med) var(--ease),
                color var(--t-med) var(--ease),
                border-color var(--t-med) var(--ease),
                transform var(--t-med) var(--ease-bounce);
}
.stepper__dot.is-active {
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
    color: white;
    border-color: transparent;
    transform: scale(1.08);
    box-shadow: 0 6px 20px var(--accent-glow);
}
.stepper__dot.is-done {
    background: rgba(74, 222, 128, 0.18);
    border-color: rgba(74, 222, 128, 0.5);
    color: #bbf7d0;
}
.stepper__bar {
    flex: 0 0 28px;
    height: 1px;
    background: var(--border-strong);
}

/* main card */
.flow-card {
    padding: 36px;
    position: relative;
    overflow: hidden;
}

/* destructive intro icon */
.flow-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--danger-soft);
    border: 1px solid rgba(255, 85, 119, 0.35);
    display: grid;
    place-items: center;
    margin-bottom: 18px;
}
.flow-icon svg { width: 26px; height: 26px; stroke: var(--danger-2); }

.flow-title {
    margin: 0 0 8px;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.flow-sub {
    margin: 0 0 26px;
    color: var(--text-mute);
    font-size: 0.96rem;
}

/* panels — only the one matching data-step is visible */
.panel {
    display: none;
    animation: panelEnter 380ms var(--ease) both;
}
[data-step="1"] .panel--request { display: block; }
[data-step="2"] .panel--verify  { display: block; }
[data-step="3"] .panel--done    { display: block; }
@keyframes panelEnter {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* OTP-style code inputs.

   Two CSS-Grid gotchas to be aware of:

   1. `1fr` resolves to `minmax(auto, 1fr)` — and `auto` falls back to the
      child's min-content. <input> elements have a default `size="20"` which
      gives them a min-content of ~150px. Six of those overflow any normal
      card. Fix: `minmax(0, 1fr)` forces the cell to actually share width.

   2. Even with that, the input inherits a chunky min-width from its `size`
      attribute. Belt-and-braces: `min-width: 0` + `width: 100%` on the
      inputs themselves so they never push the grid wider than its track.
*/
.code-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin: 8px 0 18px;
}
.code-row input {
    width: 100%;
    min-width: 0;
    height: 58px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    font-family: var(--font-mono);
    padding: 0;
    background: var(--surface-3);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    transition: border-color var(--t-fast) var(--ease),
                box-shadow var(--t-fast) var(--ease),
                background var(--t-fast) var(--ease),
                transform var(--t-fast) var(--ease);
    -moz-appearance: textfield;
}
.code-row input::-webkit-outer-spin-button,
.code-row input::-webkit-inner-spin-button {
    -webkit-appearance: none; margin: 0;
}
.code-row input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
    background: var(--surface-2);
    transform: translateY(-1px);
}
.code-row.is-error input {
    border-color: var(--danger);
    animation: shake 360ms var(--ease);
}
@keyframes shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

/* resend row */
.resend-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-mute);
    margin-top: -4px;
    margin-bottom: 18px;
}
.resend-btn {
    background: none;
    border: none;
    color: var(--accent-2);
    font-weight: 600;
    padding: 0;
    cursor: pointer;
    transition: opacity var(--t-fast) var(--ease);
}
.resend-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* "danger zone" warning block above the form */
.danger-note {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: var(--danger-soft);
    border: 1px solid rgba(255, 85, 119, 0.35);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: #ffd0d9;
    margin-bottom: 22px;
    line-height: 1.5;
}
.danger-note__icon {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    margin-top: 2px;
    color: var(--danger-2);
}

/* success state */
.done-burst {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74, 222, 128, 0.2) 0%, transparent 70%);
    display: grid;
    place-items: center;
    margin: 0 auto 22px;
    animation: burst 700ms var(--ease-bounce) both;
}
.done-burst svg {
    width: 48px; height: 48px; color: var(--success);
    animation: pop 540ms var(--ease-bounce) 120ms both;
}
@keyframes burst { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes pop   { from { transform: scale(0); }              to { transform: scale(1); } }

.done-stats {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin: 22px 0 28px;
    flex-wrap: wrap;
}
.done-stat {
    padding: 14px 20px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    min-width: 110px;
}
.done-stat__num { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.done-stat__label { font-size: 0.78rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }

.panel--done { text-align: center; }

/* button stack */
.btn-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (max-width: 540px) {
    .flow-card { padding: 22px; border-radius: var(--radius-md); }
    .flow-wrap { margin-top: 28px; padding: 0 16px; }
    .flow-title { font-size: 1.35rem; }
    .flow-sub   { font-size: 0.9rem; }
    .code-row   { gap: 6px; }
    .code-row input { font-size: 1.2rem; height: 50px; }
    .stepper    { margin-bottom: 22px; }
    .stepper__bar { flex: 0 0 18px; }
    .resend-row { flex-direction: column; align-items: flex-start; gap: 6px; }
}

@media (max-width: 360px) {
    /* Six fully-sized boxes plus gaps no longer fit. Shrink the cell
       size and font so the row keeps its shape on the smallest phones. */
    .flow-card  { padding: 18px; }
    .code-row   { gap: 4px; }
    .code-row input { height: 44px; font-size: 1.05rem; border-radius: var(--radius-sm); }
}
