/*
 * VibeKB — Account Access (account system)
 * Layered on top of the shared portfolio system (assets/css/style.css).
 * Reuses the workshop palette and typography; adds calm, precise forms and a
 * compact admin registry. Deliberately restrained: obvious, accessible inputs
 * over decoration.
 */

:root {
    --auth-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --auth-panel: linear-gradient(160deg, #201811, #14110d);
    --auth-rule: rgba(201, 164, 91, .18);
    --auth-rule-strong: rgba(201, 164, 91, .34);
    --auth-danger: #d98b6a;
    --auth-danger-bg: rgba(180, 74, 42, .12);
    --auth-focus: var(--brass-light, #d2ad62);
}

.auth-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.auth-main {
    flex: 1 0 auto;
    width: 100%;
    max-width: 60rem;
    margin: 0 auto;
    padding: clamp(1.5rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2rem) 3rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* ---- shared header nav ---- */
.auth-nav {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(.8rem, 3vw, 1.6rem);
    align-items: center;
}
.auth-nav a {
    color: var(--muted, #aaa08d);
    text-decoration: none;
    font-size: .82rem;
    letter-spacing: .04em;
    padding: .25rem 0;
    border-bottom: 1px solid transparent;
}
.auth-nav a:hover,
.auth-nav a:focus-visible {
    color: var(--ivory, #efe7d2);
    border-bottom-color: var(--auth-rule-strong);
}
.auth-nav a[aria-current="page"] {
    color: var(--brass-light, #d2ad62);
    border-bottom-color: currentColor;
}

/* ---- card ---- */
.auth-card {
    width: 100%;
    max-width: 30rem;
    background: var(--auth-panel);
    border: 1px solid var(--auth-rule);
    border-radius: 14px;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    box-shadow: var(--shadow, 0 24px 70px rgba(0, 0, 0, .52));
}
.auth-card--narrow { max-width: 26rem; text-align: center; }
.auth-card--wide { max-width: 54rem; }

.auth-card .mono,
.mono {
    font-family: var(--auth-mono);
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--brass-light, #d2ad62);
    margin: 0 0 .5rem;
}
.auth-card h1 {
    font-family: var(--display, "Cinzel", Georgia, serif);
    font-size: clamp(1.4rem, 3.5vw, 1.85rem);
    line-height: 1.2;
    margin: 0 0 .5rem;
    color: var(--ivory, #efe7d2);
}
.auth-lede {
    color: var(--muted, #aaa08d);
    margin: 0 0 1.5rem;
    line-height: 1.6;
}

/* ---- forms ---- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}
.auth-form--inline { margin-top: 1.5rem; }

.field {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.field label {
    font-size: .9rem;
    font-weight: 600;
    color: var(--paper-light, #eee1bd);
    letter-spacing: .01em;
}
.field input {
    width: 100%;
    padding: .7rem .8rem;
    background: rgba(13, 12, 10, .55);
    border: 1px solid var(--auth-rule-strong);
    border-radius: 9px;
    color: var(--ivory, #efe7d2);
    font-family: var(--sans, Inter, system-ui, sans-serif);
    font-size: 1rem;
    line-height: 1.3;
}
.field input::placeholder { color: rgba(170, 160, 141, .6); }
.field input:focus-visible {
    outline: 2px solid var(--auth-focus);
    outline-offset: 2px;
    border-color: var(--auth-focus);
}
.field__hint {
    margin: 0;
    font-size: .78rem;
    color: var(--muted, #aaa08d);
}
.field__error {
    margin: 0;
    font-size: .82rem;
    color: var(--auth-danger);
}
.field--error input {
    border-color: var(--auth-danger);
}

/* ---- error summary ---- */
.form-errors {
    border: 1px solid var(--auth-danger);
    background: var(--auth-danger-bg);
    border-radius: 10px;
    padding: .9rem 1rem;
    margin: 0 0 1.4rem;
    color: var(--paper-light, #eee1bd);
}
.form-errors:focus-visible {
    outline: 2px solid var(--auth-focus);
    outline-offset: 2px;
}
.form-errors__title { margin: 0 0 .4rem; font-weight: 600; }
.form-errors ul { margin: 0; padding-left: 1.2rem; }
.form-errors li { margin: .2rem 0; }

/* ---- buttons ---- */
.btn {
    display: inline-block;
    font-family: var(--sans, Inter, system-ui, sans-serif);
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .02em;
    padding: .7rem 1.4rem;
    border-radius: 9px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:focus-visible {
    outline: 2px solid var(--auth-focus);
    outline-offset: 2px;
}
.btn--primary {
    background: var(--brass, #ae8540);
    color: #16110a;
    align-self: flex-start;
}
.btn--primary:hover { background: var(--brass-light, #d2ad62); }
.btn--ghost {
    background: transparent;
    border-color: var(--auth-rule-strong);
    color: var(--ivory, #efe7d2);
}
.btn--ghost:hover { border-color: var(--brass-light, #d2ad62); color: var(--brass-light, #d2ad62); }
.btn--quiet {
    background: transparent;
    border-color: var(--auth-rule);
    color: var(--muted, #aaa08d);
    align-self: flex-start;
}
.btn--quiet:hover { color: var(--ivory, #efe7d2); border-color: var(--auth-rule-strong); }

.auth-alt,
.auth-note {
    margin: 1.4rem 0 0;
    font-size: .88rem;
    color: var(--muted, #aaa08d);
    line-height: 1.6;
}
.auth-alt a { color: var(--brass-light, #d2ad62); }

/* ---- account record ---- */
.record {
    margin: 0 0 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.record__row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem 0;
    border-bottom: 1px solid var(--auth-rule);
}
.record__row:last-child { border-bottom: none; }
.record dt {
    color: var(--muted, #aaa08d);
    font-size: .85rem;
    letter-spacing: .02em;
}
.record dd {
    margin: 0;
    color: var(--ivory, #efe7d2);
    text-align: right;
    word-break: break-word;
}

/* ---- role tag ---- */
.tag {
    display: inline-block;
    font-family: var(--auth-mono);
    font-size: .68rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .18rem .5rem;
    border-radius: 5px;
    border: 1px solid var(--auth-rule-strong);
    color: var(--paper, #d8c79e);
}
.tag--admin {
    color: #16110a;
    background: var(--brass-light, #d2ad62);
    border-color: var(--brass-light, #d2ad62);
}

/* ---- admin summary ---- */
.summary {
    list-style: none;
    margin: 1.4rem 0 2rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 1px;
    background: var(--auth-rule);
    border: 1px solid var(--auth-rule);
    border-radius: 10px;
    overflow: hidden;
}
.summary__stat {
    background: rgba(13, 12, 10, .4);
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.summary__value {
    font-family: var(--display, "Cinzel", Georgia, serif);
    font-size: 1.7rem;
    color: var(--ivory, #efe7d2);
    line-height: 1;
}
.summary__value--date {
    font-family: var(--auth-mono);
    font-size: 1rem;
}
.summary__label {
    font-size: .74rem;
    color: var(--muted, #aaa08d);
    letter-spacing: .03em;
}

.admin-subhead {
    font-family: var(--display, "Cinzel", Georgia, serif);
    font-size: 1.1rem;
    color: var(--paper-light, #eee1bd);
    margin: 0 0 .9rem;
}

/* ---- registry table ---- */
.table-scroll {
    overflow-x: auto;
    border: 1px solid var(--auth-rule);
    border-radius: 10px;
}
.registry {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
    min-width: 34rem;
}
.registry th,
.registry td {
    text-align: left;
    padding: .7rem .9rem;
    border-bottom: 1px solid var(--auth-rule);
    white-space: nowrap;
}
.registry th {
    font-family: var(--auth-mono);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--brass-light, #d2ad62);
    background: rgba(13, 12, 10, .5);
}
.registry td { color: var(--ivory, #efe7d2); }
.registry td:nth-child(3) { white-space: normal; word-break: break-word; }
.registry tbody tr:last-child td { border-bottom: none; }
.registry tbody tr:hover td { background: rgba(201, 164, 91, .05); }

/* ---- footer ---- */
.auth-footer {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .5rem 1.5rem;
    padding: 1.5rem clamp(1rem, 4vw, 2rem);
    border-top: 1px solid var(--auth-rule);
    color: var(--muted, #aaa08d);
    font-family: var(--auth-mono);
    font-size: .72rem;
    letter-spacing: .05em;
}

/* ---- VibeKB page account strip ---- */
.lab-account-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    align-items: center;
}
.lab-account-nav .btn { padding: .5rem 1rem; font-size: .85rem; }

/* ---- experiment visibility additions ---- */
.flash {
    margin: 0 0 1.2rem;
    padding: .7rem 1rem;
    border: 1px solid var(--auth-rule-strong);
    border-radius: 9px;
    background: rgba(69, 100, 87, .18);
    color: var(--paper-light, #eee1bd);
    font-size: .9rem;
}
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}
.inline-select { margin: 0; }
.inline-select select {
    background: rgba(13, 12, 10, .55);
    border: 1px solid var(--auth-rule-strong);
    border-radius: 7px;
    color: var(--ivory, #efe7d2);
    font-family: var(--sans, Inter, system-ui, sans-serif);
    font-size: .82rem;
    padding: .3rem .4rem;
}
.inline-select select:focus-visible {
    outline: 2px solid var(--auth-focus);
    outline-offset: 2px;
}
.field select {
    width: 100%;
    padding: .7rem .8rem;
    background: rgba(13, 12, 10, .55);
    border: 1px solid var(--auth-rule-strong);
    border-radius: 9px;
    color: var(--ivory, #efe7d2);
    font-family: var(--sans, Inter, system-ui, sans-serif);
    font-size: 1rem;
}
.field select:focus-visible {
    outline: 2px solid var(--auth-focus);
    outline-offset: 2px;
    border-color: var(--auth-focus);
}
.private-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.private-list__item {
    padding: .9rem 0;
    border-bottom: 1px solid var(--auth-rule);
}
.private-list__item:last-child { border-bottom: none; }
.private-list__name {
    color: var(--brass-light, #d2ad62);
    font-weight: 600;
    margin-right: .6rem;
}
.private-list__desc {
    margin: .4rem 0 0;
    color: var(--muted, #aaa08d);
    font-size: .88rem;
}

/* ---- Ideas dashboard ---- */
.ideas-dash__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: .5rem;
}
.ideas-dash__header .auth-lede { margin-bottom: 0; }
.ideas-summary { margin-top: 1.2rem; }

.ideas-filters {
    margin: 0 0 1.8rem;
    padding: 1rem 0 0;
    border-top: 1px solid var(--auth-rule);
}
.ideas-filters__row {
    display: grid;
    grid-template-columns: 1fr;
    gap: .9rem;
}
@media (min-width: 640px) {
    .ideas-filters__row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .ideas-filters__search { grid-column: 1 / -1; }
}
@media (min-width: 960px) {
    .ideas-filters__row {
        grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
    }
    .ideas-filters__search { grid-column: auto; }
}
.ideas-filters__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    margin-top: 1rem;
}

.ideas-capture {
    margin: 0 0 2rem;
    padding: 1.2rem 0 0;
    border-top: 1px solid var(--auth-rule);
}
.ideas-capture__form { margin-top: .8rem; }

.ideas-empty {
    padding: 1.4rem 0;
    color: var(--muted, #aaa08d);
    line-height: 1.6;
}
.ideas-empty p { margin: 0 0 .7rem; }

.idea-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .9rem;
}
.idea-card {
    border: 1px solid var(--auth-rule);
    border-radius: 12px;
    background: rgba(13, 12, 10, .35);
    overflow: hidden;
}
.idea-card--paused { opacity: .88; }
.idea-card--archived {
    opacity: .72;
    border-style: dashed;
}
.idea-card__link {
    display: block;
    padding: 1rem 1.1rem .7rem;
    color: inherit;
    text-decoration: none;
    min-height: 3rem;
}
.idea-card__link:hover .idea-card__name,
.idea-card__link:focus-visible .idea-card__name {
    color: var(--brass-light, #d2ad62);
}
.idea-card__link:focus-visible {
    outline: 2px solid var(--auth-focus);
    outline-offset: -2px;
}
.idea-card__top {
    display: flex;
    justify-content: space-between;
    gap: .8rem;
    margin-bottom: .35rem;
}
.idea-card__code {
    font-family: var(--auth-mono);
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--brass-light, #d2ad62);
}
.idea-card__vis {
    font-family: var(--auth-mono);
    font-size: .68rem;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted, #aaa08d);
}
.idea-card__name {
    font-family: var(--display, "Cinzel", Georgia, serif);
    font-size: 1.15rem;
    margin: 0 0 .35rem;
    color: var(--ivory, #efe7d2);
    line-height: 1.25;
}
.idea-card__desc {
    margin: 0 0 .7rem;
    color: var(--muted, #aaa08d);
    font-size: .92rem;
    line-height: 1.5;
}
.idea-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem .6rem;
    align-items: center;
    margin-bottom: .75rem;
}
.idea-card__updated {
    font-size: .78rem;
    color: var(--muted, #aaa08d);
}
.idea-card__next {
    margin: 0;
    padding: .75rem .85rem;
    border-radius: 9px;
    background: rgba(201, 164, 91, .08);
    border: 1px solid var(--auth-rule);
    color: var(--paper-light, #eee1bd);
    font-size: .92rem;
    line-height: 1.45;
}
.idea-card__next--empty { color: var(--muted, #aaa08d); font-style: italic; }
.idea-card__next-label {
    display: block;
    font-family: var(--auth-mono);
    font-size: .65rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--brass-light, #d2ad62);
    margin-bottom: .25rem;
    font-style: normal;
}
.idea-card__open {
    margin: 0;
    padding: 0 1.1rem 1rem;
}
.idea-card__open a {
    color: var(--brass-light, #d2ad62);
    font-size: .88rem;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}
.idea-card__open a:hover,
.idea-card__open a:focus-visible {
    border-bottom-color: currentColor;
}

.badge {
    display: inline-block;
    font-family: var(--auth-mono);
    font-size: .66rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .2rem .5rem;
    border-radius: 5px;
    border: 1px solid var(--auth-rule-strong);
    color: var(--paper, #d8c79e);
}
.badge--status { color: var(--ivory, #efe7d2); }
.badge--inbox { border-color: rgba(170, 160, 141, .45); }
.badge--exploring,
.badge--validating { border-color: rgba(120, 154, 113, .45); color: #b7c9b2; }
.badge--building { border-color: rgba(201, 164, 91, .55); color: var(--brass-light, #d2ad62); }
.badge--testing { border-color: rgba(110, 150, 180, .55); color: #a8c4d8; }
.badge--launched { border-color: rgba(120, 154, 113, .7); background: rgba(69, 100, 87, .22); }
.badge--paused { border-color: rgba(170, 160, 141, .35); color: var(--muted, #aaa08d); }
.badge--archived { border-style: dashed; color: var(--muted, #aaa08d); }
.badge--pri-high { color: #e0a48a; border-color: rgba(217, 139, 106, .55); }
.badge--pri-normal { color: var(--paper, #d8c79e); }
.badge--pri-low { color: var(--muted, #aaa08d); }

/* ---- Idea workspace ---- */
.idea-workspace__title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .5rem 1rem;
    margin-bottom: .7rem;
}
.idea-workspace__title h1 { margin-bottom: 0; }
.idea-workspace__code {
    font-family: var(--auth-mono);
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--brass-light, #d2ad62);
}
.idea-workspace__nav {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    align-items: center;
    margin: 0 0 1.2rem;
}
.idea-workspace__inline-form { margin: 0; display: inline; }
.idea-workspace__form { gap: 0; }
.idea-section {
    margin: 0 0 1.6rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--auth-rule);
}
.idea-section:first-of-type { border-top: none; padding-top: 0; }
.idea-section__pair {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.1rem;
}
@media (min-width: 560px) {
    .idea-section__pair { grid-template-columns: 1fr 1fr; }
}
.field textarea {
    width: 100%;
    padding: .7rem .8rem;
    background: rgba(13, 12, 10, .55);
    border: 1px solid var(--auth-rule-strong);
    border-radius: 9px;
    color: var(--ivory, #efe7d2);
    font-family: var(--sans, Inter, system-ui, sans-serif);
    font-size: 1rem;
    line-height: 1.45;
    resize: vertical;
    min-height: 5rem;
}
.field textarea:focus-visible {
    outline: 2px solid var(--auth-focus);
    outline-offset: 2px;
    border-color: var(--auth-focus);
}
.field--error textarea { border-color: var(--auth-danger); }
.field--next input {
    border-color: rgba(201, 164, 91, .45);
    background: rgba(201, 164, 91, .06);
}
.idea-advanced {
    margin: 0 0 1.4rem;
    border: 1px solid var(--auth-rule);
    border-radius: 10px;
    padding: .2rem .9rem .9rem;
    background: rgba(13, 12, 10, .25);
}
.idea-advanced > summary {
    cursor: pointer;
    font-family: var(--display, "Cinzel", Georgia, serif);
    font-size: 1.05rem;
    color: var(--paper-light, #eee1bd);
    padding: .8rem 0;
    list-style-position: outside;
}
.idea-advanced > summary:focus-visible {
    outline: 2px solid var(--auth-focus);
    outline-offset: 2px;
}
.idea-advanced__body {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    padding-top: .3rem;
}
.idea-section--invites {
    margin-top: 2rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--auth-rule);
}

@media (max-width: 640px) {
    .auth-main { padding-left: .85rem; padding-right: .85rem; }
    .auth-card--wide { padding: 1.2rem; }
    .summary__value { font-size: 1.4rem; }
    .idea-card__link { padding: .95rem .95rem .65rem; }
}
