/* ============================================================================
   SANJE Model Registration — layout & components
   Built on the same design tokens as the SANJE Leaderboard Space
   (assets/theme.css, copied verbatim) so both Spaces read as one product:
   dark ground, teal accent, rounded panels, tabular mono for numbers/ids.
============================================================================ */

.page {
    max-width: 880px;
    margin: 0 auto;
    padding: 28px 24px 80px;
}

/* ---------- Top nav (same pattern as the Leaderboard Space) ---------- */
.topnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 22px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--border);
}
.topnav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.topnav-mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent) 0%, #2b8f86 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: #06201d;
    flex-shrink: 0;
}
.topnav-title {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.01em;
}
.topnav-sub {
    color: var(--text-faint);
    font-size: 12px;
    margin-top: 1px;
}
.topnav-links {
    display: flex;
    align-items: center;
    gap: 22px;
    font-size: 13px;
    color: var(--text-muted);
}
.topnav-links a {
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.topnav-links a:hover {
    color: var(--text);
    text-decoration: none;
}
.topnav-links a.ext svg {
    opacity: 0.55;
}

/* ---------- Hero ---------- */
.hero {
    text-align: center;
    padding: 6px 0 28px;
}
.hero-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}
.hero-logo-img {
    /* The joint AmirKabir/SANJE lockup sits straight on the near-black ground:
       the asset carries an alpha channel and its navy line art was recoloured
       to the page text colour, so no white plaque is needed. Wide artwork:
       cap the width, not the height. */
    width: 100%;
    max-width: 420px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 14px rgba(79, 209, 197, 0.25));
}
.hero-logo .hero-emblem {
    display: none;
    margin-bottom: 0;
}
.hero-logo--fallback .hero-logo-img {
    display: none;
}
.hero-logo--fallback .hero-emblem {
    display: block;
}
.hero-emblem {
    font-size: 34px;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 14px rgba(79, 209, 197, 0.25));
}
.hero h1 {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}
.hero h1 .full-name {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14.5px;
    display: block;
    margin-top: 6px;
    letter-spacing: 0;
}
.hero p.tagline {
    color: var(--text-muted);
    font-size: 14.5px;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ---------- Steps strip ---------- */
.steps-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 28px 0;
}
.step-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
}
.step-num {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: var(--accent-dim);
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}
.step-title {
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 4px;
}
.step-desc {
    font-size: 12px;
    color: var(--text-faint);
    line-height: 1.5;
}

/* ---------- Form card ---------- */
.form-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 26px 26px 22px;
    box-shadow: var(--shadow-sm);
}
.form-section + .form-section {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-row + .field,
.field + .form-row,
.form-row + .form-row {
    margin-top: 16px;
}

/* Honeypot field: present in the DOM (so bots find it) but invisible and
   unreachable for real/keyboard users. */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.field-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
}
.req {
    color: var(--danger);
}
.field-optional {
    color: var(--text-faint);
    font-weight: 500;
}
.field input,
.field textarea {
    width: 100%;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 11px 13px;
    font-size: 13.5px;
    color: var(--text);
    font-family: var(--font-ui);
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
    resize: vertical;
}
.field input::placeholder,
.field textarea::placeholder {
    color: var(--text-faint);
}
.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.field.has-error input,
.field.has-error textarea {
    border-color: rgba(248, 113, 113, 0.5);
}
.field-hint {
    font-size: 11.5px;
    color: var(--text-faint);
}
.task-pills-hint {
    margin: 2px 0 12px;
}
.field-error {
    font-size: 11.5px;
    color: var(--danger);
    min-height: 0;
}

/* ---------- Task pills (checkbox grid) ---------- */
.task-pills {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.task-pills.has-error {
    outline: 1px solid rgba(248, 113, 113, 0.4);
    outline-offset: 6px;
    border-radius: var(--radius);
}
.task-pill {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel-2);
    cursor: pointer;
    transition: all 0.14s ease;
}
.task-pill input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.task-pill:hover {
    border-color: var(--border-strong);
}
.task-pill.is-checked {
    border-color: rgba(79, 209, 197, 0.45);
    background: var(--accent-dim);
}
.task-pill:focus-within {
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.task-pill-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.task-pill.is-checked .task-pill-label {
    color: var(--accent);
}
.task-pill-label::before {
    content: "";
    width: 15px;
    height: 15px;
    border-radius: 4px;
    border: 1.5px solid var(--border-strong);
    background: var(--bg-raised);
    flex-shrink: 0;
    transition: all 0.14s ease;
}
.task-pill.is-checked .task-pill-label::before {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: inset 0 0 0 3px var(--panel-2);
}
.task-pill-desc {
    font-size: 11.5px;
    color: var(--text-faint);
    line-height: 1.4;
    padding-left: 23px;
}

/* ---------- Task categories (category select-all + benchmark checkboxes) ---------- */
.task-categories {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.task-category {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel-2);
    overflow: hidden;
    transition: border-color 0.14s ease;
}
.task-category.has-selection {
    border-color: rgba(79, 209, 197, 0.35);
}
.task-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
}
.task-category-header input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    flex-shrink: 0;
    cursor: pointer;
}
.task-category-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
}
.task-category-count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-faint);
    font-family: var(--font-mono);
}
.task-category.has-selection .task-category-count {
    color: var(--accent);
}
.task-benchmarks {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px 4px;
    padding: 4px 14px 12px 40px;
}
.task-benchmark {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px;
    border-radius: 6px;
    font-size: 12.5px;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.12s ease;
}
.task-benchmark:hover {
    background: var(--bg-raised);
}
.task-benchmark input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--accent);
    flex-shrink: 0;
    cursor: pointer;
}
.task-benchmark.is-checked {
    color: var(--text);
}
.task-categories.has-error .task-category {
    border-color: rgba(248, 113, 113, 0.4);
}

/* ---------- Banners ---------- */
.form-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 18px;
}

.form-banner[hidden] {
    display: none;
}

.form-banner-error {
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: #ffb4b4;
}

/* ---------- Footer / submit row ---------- */
.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.footnote-inline {
    font-size: 12px;
    color: var(--text-faint);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent) 0%, #2b8f86 100%);
    color: #06201d;
    font-weight: 700;
    font-size: 13.5px;
    border: none;
    border-radius: var(--radius);
    padding: 12px 22px;
    cursor: pointer;
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        opacity 0.12s ease;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px var(--accent-glow);
    transform: translateY(-1px);
}
.btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.btn-primary .spinner {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    display: block;
}

.btn-primary .spinner[hidden] {
    display: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--panel-2);
    border: 1px solid var(--border-strong);
    color: var(--text);
    font-weight: 600;
    font-size: 13px;
    border-radius: var(--radius);
    padding: 10px 18px;
    cursor: pointer;
    transition: all 0.14s ease;
}
.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ---------- Success card ---------- */
.success-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.success-badge {
    width: 60px;
    height: 60px;
    margin: 0 auto 18px;
    border-radius: 999px;
    background: var(--accent-dim);
    border: 1px solid rgba(79, 209, 197, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success);
    box-shadow: 0 0 0 8px rgba(74, 222, 128, 0.06);
}
.success-card h2 {
    font-size: 22px;
    margin: 0 0 10px;
    font-weight: 800;
}
.success-sub {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    max-width: 480px;
    margin: 0 auto 22px;
}
.success-meta {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin: 0 auto 24px;
    max-width: 420px;
    text-align: left;
}
.success-meta-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.success-meta-row:last-child {
    border-bottom: none;
}
.success-meta-label {
    font-size: 11px;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    padding-top: 2px;
    flex-shrink: 0;
}
.success-meta-value {
    font-size: 12.5px;
    color: var(--text);
    text-align: right;
}
.success-task-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}
.success-task-pill {
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--accent-dim);
    color: var(--accent);
    font-weight: 600;
}

/* ---------- Footnote ---------- */
.footnote {
    text-align: center;
    color: var(--text-faint);
    font-size: 12px;
    margin-top: 26px;
    line-height: 1.7;
}
.footnote code {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 5px;
    font-family: var(--font-mono);
    font-size: 11.5px;
}

@media (max-width: 720px) {
    .form-row,
    .task-pills,
    .steps-strip {
        grid-template-columns: 1fr;
    }
    .task-benchmarks {
        grid-template-columns: 1fr 1fr;
        padding-left: 32px;
    }
    .page {
        padding: 20px 14px 60px;
    }
    .hero h1 {
        font-size: 24px;
    }
    .form-card {
        padding: 20px 18px 18px;
    }
    .form-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .btn-primary {
        justify-content: center;
    }
    .success-meta-row {
        flex-direction: column;
        gap: 4px;
    }
    .success-meta-value,
    .success-task-list {
        text-align: left;
        justify-content: flex-start;
    }
}
