/* Signup + Restore page styling. Uses the landing.css palette
 * (--fg, --bg, --card-bg, --accent, --muted) so dark mode just works.
 *
 * NOTE on layering: landing.css defines the design tokens on :root and
 * styles the body / nav. signup.css adds the components that the
 * /signup and /restore pages need (backup-key reveal, confirmation
 * inputs, the secondary buttons, etc.). dashboard.css is NOT loaded
 * here, so anything we need from there (like .card) has to be defined
 * in this file too.
 */

.signup-hero {
    max-width: 720px;
    margin: 4rem auto;
    padding: 0 1rem;
}

#signup-app, #restore-app {
    margin-top: 2rem;
}

/* Step indicator above the signup app. Highlights the current step
 * so the user always knows where the next click goes. */
.signup-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.6rem;
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    font-size: 0.85rem;
    color: var(--muted);
    counter-reset: signupstep;
}
.signup-steps li {
    counter-increment: signupstep;
    padding: 0.35rem 0.7rem;
    border: 1px solid rgba(127, 127, 127, 0.3);
    border-radius: 999px;
    background: transparent;
    transition: background 0.15s ease-out, color 0.15s ease-out;
}
.signup-steps li::before {
    content: counter(signupstep) ". ";
    color: var(--muted);
    font-weight: 600;
}
.signup-steps li.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.signup-steps li.active::before {
    color: rgba(255, 255, 255, 0.85);
}

.substep {
    margin-top: 1rem;
    margin-bottom: 0.4rem;
}

/* The primary CTA. Inherits the .cta look from landing.css but lives
 * as a real <button>. */
#signup-btn, #restore-btn {
    background: var(--accent);
    color: white;
    border: 0;
    padding: 0.85rem 1.5rem;
    font: inherit;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    border-radius: 8px;
}
#signup-btn:hover:not(:disabled),
#restore-btn:hover:not(:disabled) {
    background: var(--accent-hover);
}
#signup-btn:disabled, #restore-btn:disabled {
    background: rgba(127, 127, 127, 0.35);
    color: rgba(255, 255, 255, 0.85);
    cursor: not-allowed;
}

/* Card containers (signup backup panel, restore overwrite confirm,
 * dashboard sections). Local copy since dashboard.css isn't loaded
 * on this page. */
section.card {
    background: var(--card-bg);
    color: var(--fg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}
section.card h2 {
    margin-top: 0;
    font-size: 1.25rem;
}
section.card h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.4rem;
    font-size: 1.05rem;
}
section.card p {
    margin: 0.6rem 0;
}

/* Secondary buttons inside the card (Show / Download / Regenerate). */
section.card button {
    background: transparent;
    color: var(--fg);
    border: 1px solid rgba(127, 127, 127, 0.45);
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    font: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    margin-right: 0.4rem;
}
section.card button:hover:not(:disabled) {
    background: rgba(127, 127, 127, 0.18);
}
section.card button:disabled {
    color: var(--muted);
    cursor: not-allowed;
}

/* The backup-key reveal block. Monospace, large, user-selectable.
 * Blurred until the user clicks "Show backup key" (JS sets
 * `style.filter`). */
.backup-key {
    background: rgba(127, 127, 127, 0.12);
    color: var(--fg);
    border: 1px solid rgba(127, 127, 127, 0.3);
    border-radius: 6px;
    padding: 1rem 1.2rem;
    margin-top: 0.6rem;
    margin-bottom: 0.8rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.05rem;
    line-height: 1.5;
    letter-spacing: 0.05em;
    white-space: pre;
    user-select: all;
    transition: filter 0.15s ease-out;
}
@media (max-width: 30rem) {
    .backup-key { font-size: 0.9rem; }
}

/* Full-key confirmation input — the gate the user has to satisfy
 * before signup actually happens. Multi-line monospace; whitespace
 * tolerant on the JS side. */
#confirm-full {
    background: var(--bg);
    color: var(--fg);
    border: 1px solid rgba(127, 127, 127, 0.45);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1rem;
    width: 100%;
    margin: 0.3rem 0;
    resize: vertical;
    min-height: 4.5rem;
}
#confirm-full:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

#confirm-indicator {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    min-height: 1.2em;
    margin: 0.3rem 0 0.7rem;
}
#confirm-indicator.ok { color: #2a8a2a; }
@media (prefers-color-scheme: dark) {
    #confirm-indicator.ok { color: #6acf6a; }
}
#confirm-indicator.bad { color: #c83232; }
@media (prefers-color-scheme: dark) {
    #confirm-indicator.bad { color: #ff8a8a; }
}

#done-saving-btn {
    background: var(--accent);
    color: white;
    border: 0;
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.4rem;
}
#done-saving-btn:hover:not(:disabled) { background: var(--accent-hover); }

section.card label {
    display: block;
    margin: 0.5rem 0;
    color: var(--fg);
}
section.card label input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: translateY(1px);
}

/* The continue button is the gate to the dashboard — give it the
 * primary CTA look. */
#continue-btn {
    background: var(--accent);
    color: white;
    border: 0;
    padding: 0.7rem 1.3rem;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.6rem;
}
#continue-btn:hover:not(:disabled) {
    background: var(--accent-hover);
}
#continue-btn:disabled {
    background: rgba(127, 127, 127, 0.35);
    color: rgba(255, 255, 255, 0.85);
    cursor: not-allowed;
}

/* In-card warning callout. Amber stripe + tinted background; works in
 * both color schemes. Local copy of the dashboard.css class since
 * dashboard.css isn't loaded here. */
.warn {
    background: rgba(220, 160, 0, 0.12);
    border-left: 3px solid rgba(220, 160, 0, 0.6);
    padding: 0.6rem 0.9rem;
    border-radius: 4px;
    font-size: 0.95rem;
    color: var(--fg);
    margin-top: 1rem;
}

/* Auxiliary copy under the backup card. */
.micro {
    color: var(--muted);
    font-size: 0.9rem;
}

/* Status / result panels (JS-driven log). */
#signup-status,
#signup-result,
#restore-status {
    background: var(--card-bg);
    color: var(--fg);
    border: 1px solid rgba(127, 127, 127, 0.3);
    border-radius: 4px;
    padding: 1rem;
    margin-top: 1rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 26rem;
    overflow: auto;
}
#signup-status:empty,
#signup-result:empty,
#restore-status:empty {
    /* Don't render an empty visible box before the JS has anything to say. */
    border: 0;
    padding: 0;
    margin: 0;
}

/* /restore page specifics. */
#restore-key {
    background: var(--bg);
    color: var(--fg);
    border: 1px solid rgba(127, 127, 127, 0.45);
    border-radius: 6px;
    padding: 0.7rem 0.9rem;
    width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.95rem;
    margin-top: 0.4rem;
    resize: vertical;
}
#restore-key:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
#replace-input {
    background: var(--bg);
    color: var(--fg);
    border: 1px solid rgba(127, 127, 127, 0.45);
    border-radius: 6px;
    padding: 0.5rem 0.8rem;
    font: inherit;
    width: 12rem;
}
#restore-existing code,
.card code {
    background: rgba(127, 127, 127, 0.18);
    color: var(--fg);
    padding: 0.05em 0.4em;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.95em;
}

.error {
    background: rgba(200, 0, 0, 0.12);
    border-left: 3px solid rgba(200, 0, 0, 0.7);
    color: var(--fg);
    padding: 0.7rem 0.95rem;
    border-radius: 4px;
}
