/* Shared tokens, nav, hero, tabs and the code viewer are in shared/site.css. */

/* ─── RESET ────────────────────────────────────────────────── */

:root {
    --error:   #f04d6e;
    --success: var(--accent);
    --font-d: var(--font-display);
    --font-m: var(--font-mono);
}

/* ─── CARD ─────────────────────────────────────────────────── */
.card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    animation: fadeUp 0.5s ease both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── HEADER ───────────────────────────────────────────────── */
.card-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.eyebrow {
    font-family: var(--font-m);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

.title {
    font-size: clamp(2rem, 7vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
}

.subtitle {
    font-family: var(--font-m);
    font-size: 0.875rem;
    color: var(--muted);
    font-weight: 300;
    line-height: 1.5;
    margin-top: 2px;
}

/* ─── INPUT AREA ───────────────────────────────────────────── */
.input-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
    background: var(--bg);
}

.input-wrap:focus-within {
    border-color: var(--accent);
}

.input-wrap.invalid:focus-within {
    border-color: var(--error);
}

.input-wrap.valid:focus-within {
    border-color: var(--accent);
}

.name-input {
    width: 100%;
    padding: 16px 18px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font-d);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.name-input::placeholder {
    color: var(--muted);
    font-weight: 400;
}

/* Progress bar */
.char-bar {
    height: 3px;
    background: var(--border);
    width: 100%;
}

.char-fill {
    height: 100%;
    width: 0%;
    background: var(--error);
    transition: width 0.2s ease, background 0.3s ease;
}

.char-fill.valid {
    background: var(--accent);
}

/* Meta row */
.input-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2px;
}

.char-count {
    font-family: var(--font-m);
    font-size: 0.75rem;
    color: var(--muted);
}

.validity {
    font-family: var(--font-m);
    font-size: 0.75rem;
    color: var(--muted);
    transition: color 0.2s;
}

.validity.ok  { color: var(--accent); }
.validity.bad { color: var(--error); }

/* ─── SUBMIT BUTTON ────────────────────────────────────────── */
.submit-btn {
    width: 100%;
    padding: 15px;
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: 12px;
    font-family: var(--font-d);
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    letter-spacing: -0.01em;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.2s, background 0.2s;
    box-shadow: 0 4px 24px rgba(34,211,238,0.25);
}

.submit-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(34,211,238,0.4);
}

.submit-btn:not(:disabled):active { transform: translateY(0); }

.submit-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: var(--muted);
    box-shadow: none;
}

/* ─── RESULT ───────────────────────────────────────────────── */
.result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 16px;
    background: var(--accent-dim);
    border: 1px solid rgba(34,211,238,0.2);
    border-radius: 14px;
    animation: resultIn 0.35s cubic-bezier(0.34,1.3,0.64,1) both;
}

.result.hidden { display: none; }

.result.error {
    background: rgba(240,77,110,0.1);
    border-color: rgba(240,77,110,0.25);
}

@keyframes resultIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

.result-icon {
    font-size: 2rem;
    line-height: 1;
}

.result-text {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-align: center;
}

.try-again {
    font-family: var(--font-m);
    font-size: 0.78rem;
    color: var(--muted);
    background: none;
    border: none;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: color 0.2s;
    padding: 4px 0;
}

.try-again:hover { color: var(--accent); }

/* ─── FOOTER NOTE ──────────────────────────────────────────── */
.footer-note {
    font-family: var(--font-m);
    font-size: 0.875rem;
    color: var(--muted);
    letter-spacing: 0.05em;
    opacity: 0.6;
}

@media (max-width: 480px) {
    .card { padding: 28px 20px; }
}
