/* Login, one-time code, password reset and workspace registration,
   from the Claude Design file "Login & Signup v2". Markup: src/html/auth.html,
   views: src/auth/index.js. */

:root {
    --au-font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --au-ink: #141a2e;
    --au-label: #2a3150;
    --au-text: #5b6275;
    --au-muted: #7a8199;
    --au-faint: #9aa1b4;
    --au-line: #dde1ea;
    --au-line-soft: #e6e8ef;
    --au-tint: #f5f6f9;
    --au-tab: #f1f3f8;
    --au-navy: #1f3a8f;
    --au-panel: #1a2f7a;
    --au-green: #26a844;
    --au-green-ink: #1d8a3a;
    --au-green-tint: #e6f5ea;
    --au-red: #d0342c;
    --au-ring: 0 0 0 4px rgba(31, 58, 143, .12);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    background: #fff;
}

body {
    font-family: var(--au-font);
    color: var(--au-ink);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--au-navy);
    text-decoration: none;
    font-weight: 600;
}

a:hover {
    color: var(--au-green);
}

button,
input,
select {
    font: inherit;
}

input::placeholder {
    color: var(--au-faint);
}

[hidden] {
    display: none !important;
}

.au {
    min-height: 100vh;
    display: flex;
    flex-wrap: wrap;
    background: #fff;
}

/* ---------- brand panel ---------- */

.au-aside {
    flex: 1 1 360px;
    min-width: 0;
    background: var(--au-panel);
    color: #fff;
    padding: 40px 48px;
}

.au-aside-inner {
    position: sticky;
    top: 40px;
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.au-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    align-self: flex-start;
}

.au-brand:hover {
    color: #fff;
}

.au-brand-mark {
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.au-brand-mark img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.au-brand-name {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.01em;
    text-transform: uppercase;
}

.au-brand-name span {
    color: #3fcf63;
}

.au-aside-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.au-pitch {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 32px;
}

.au-illustration {
    width: 100%;
    max-width: 560px;
    aspect-ratio: 4 / 3;
    border-radius: 20px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.au-illustration img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.au-pitch-text {
    max-width: 460px;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.02em;
}

.au-reg-intro {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    padding-top: 24px;
}

.au-reg-intro b {
    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.02em;
}

.au-reg-intro span {
    font-size: 14.5px;
    line-height: 1.6;
    color: #c9d3f2;
}

.au-steps {
    display: flex;
    flex-direction: column;
    margin-top: 36px;
}

.au-step {
    display: grid;
    grid-template-columns: 30px 1fr;
    column-gap: 16px;
}

.au-step-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.au-step-dot {
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .35);
    color: #c9d3f2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.au-step-line {
    width: 2px;
    flex: 1;
    min-height: 30px;
    margin: 6px 0;
    border-radius: 2px;
    background: rgba(255, 255, 255, .2);
}

.au-step-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 4px 0 26px;
}

.au-step-text b {
    font-size: 15px;
    font-weight: 700;
    color: #c9d3f2;
}

.au-step-text span {
    font-size: 13px;
    color: #a9b5e0;
}

.au-step.is-current .au-step-dot {
    background: #fff;
    border-color: #fff;
    color: var(--au-panel);
}

.au-step.is-current .au-step-text b,
.au-step.is-done .au-step-text b {
    color: #fff;
}

.au-step.is-current .au-step-text span {
    color: #dfe5f8;
}

.au-step.is-done .au-step-dot {
    background: #3fcf63;
    border-color: #3fcf63;
    color: #0f2a12;
}

.au-step.is-done .au-step-line {
    background: #3fcf63;
}

/* ---------- form side ---------- */

.au-main {
    flex: 1.4 1 460px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.au-top {
    height: 76px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 clamp(20px, 4vw, 48px);
}

.au-back {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    color: #4a5170;
}

.au-switch {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    color: var(--au-text);
    white-space: nowrap;
}

.au-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px clamp(20px, 4vw, 48px) 64px;
}

.au-center.is-top {
    align-items: flex-start;
}

.au-form-wrap {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
}

.au-form-wrap.is-wide {
    max-width: 600px;
}

.au-view {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.au-head {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.au-head h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -.02em;
}

.au-head p {
    margin: 0;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--au-text);
}

.au-eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
}

.au-eyebrow span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--au-green);
}

.au-bars {
    display: flex;
    gap: 4px;
}

.au-bars i {
    width: 22px;
    height: 4px;
    border-radius: 2px;
    background: #e3e6ec;
}

.au-bars i.is-on {
    background: var(--au-green);
}

.au-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: var(--au-tab);
}

.au-tabs button {
    height: 38px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--au-text);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}

.au-tabs button.is-active {
    background: #fff;
    color: var(--au-ink);
    box-shadow: 0 1px 3px rgba(20, 26, 46, .12);
}

.au-tabs-sm {
    border-radius: 10px;
}

.au-tabs-sm button {
    height: 34px;
    padding: 0 16px;
    border-radius: 7px;
    font-size: 13px;
    white-space: nowrap;
}

.au-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.au-form.is-loose {
    gap: 30px;
}

.au-fieldset {
    margin: 0;
    padding: 0;
    border: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.au-fieldset legend {
    padding: 0;
    margin-bottom: 16px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--au-muted);
}

.au-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 18px 16px;
}

.au-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.au-label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.au-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--au-label);
}

.au-req {
    color: var(--au-red);
}

.au-input {
    height: 46px;
    width: 100%;
    padding: 0 14px;
    border: 1px solid var(--au-line);
    border-radius: 10px;
    font-size: 14px;
    color: var(--au-ink);
    outline: none;
    background: #fff;
}

select.au-input {
    padding: 0 12px;
    cursor: pointer;
}

select.au-input.is-empty {
    color: var(--au-muted);
}

.au-input:focus {
    border-color: var(--au-navy);
    box-shadow: var(--au-ring);
}

.au-input:disabled {
    background: var(--au-tint);
    cursor: not-allowed;
}

.au-input.is-invalid {
    border-color: var(--au-red);
}

.au-input-sm {
    height: 42px;
    font-size: 13.5px;
    font-variant-numeric: tabular-nums;
}

.au-upper {
    text-transform: uppercase;
    letter-spacing: .04em;
}

.au-pw {
    position: relative;
}

.au-pw .au-input {
    padding-right: 46px;
}

.au-eye {
    position: absolute;
    right: 6px;
    top: 6px;
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a5170;
    border-radius: 8px;
}

.au-eye:hover {
    background: var(--au-tab);
}

.au-eye .au-eye-slash {
    display: none;
}

.au-eye.is-on .au-eye-slash {
    display: inline;
}

.au-err {
    font-size: 12.5px;
    color: var(--au-red);
}

.au-err:empty {
    display: none;
}

.au-ok {
    font-size: 12.5px;
    color: var(--au-green-ink);
    font-weight: 600;
}

.au-hint {
    font-size: 12.5px;
    color: var(--au-muted);
}

.au-btn {
    height: 48px;
    border: 0;
    border-radius: 10px;
    background: var(--au-navy);
    color: #fff;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
}

.au-btn:hover {
    opacity: .9;
}

.au-btn:disabled {
    opacity: .6;
    cursor: progress;
}

.au-form > .au-btn,
.au-form .au-actions {
    margin-top: 6px;
}

.au-btn-ghost {
    border: 1px solid var(--au-line);
    background: #fff;
    color: var(--au-label);
    font-weight: 600;
}

.au-btn-ghost:hover {
    background: var(--au-tint);
    opacity: 1;
}

.au-btn-sm {
    height: 42px;
    padding: 0 18px;
    font-size: 14px;
}

.au-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.au-actions .au-btn:last-child {
    flex: 1;
    min-width: 200px;
}

.au-chip-btn {
    flex: none;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--au-line);
    border-radius: 8px;
    background: #fff;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--au-navy);
    cursor: pointer;
}

.au-chip-btn:hover {
    background: var(--au-tab);
}

.au-sent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px 10px 14px;
    border-radius: 10px;
    background: var(--au-tint);
}

.au-sent-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.au-sent-text small {
    font-size: 12px;
    color: var(--au-muted);
}

.au-sent-text b {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.au-avatar {
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 50%;
    background: var(--au-navy);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.au-verified {
    flex: none;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    padding: 0 9px;
    border-radius: 12px;
    background: var(--au-green-tint);
    color: var(--au-green-ink);
    font-size: 12px;
    font-weight: 700;
}

.au-codes {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.au-code {
    height: 54px;
    width: 100%;
    padding: 0;
    text-align: center;
    border: 1.5px solid var(--au-line);
    border-radius: 12px;
    font-size: 22px;
    font-weight: 700;
    color: var(--au-ink);
    outline: none;
    background: #fff;
    caret-color: var(--au-navy);
}

.au-code:focus {
    border-color: var(--au-navy);
    box-shadow: var(--au-ring);
}

.au-code.has-value {
    border-color: var(--au-navy);
    background: #f6f8fe;
}

.au-codes.is-error .au-code {
    border-color: var(--au-red);
}

.au-codes.is-ok .au-code {
    border-color: var(--au-green);
    background: #eef8f0;
}

.au-code:disabled {
    cursor: not-allowed;
}

.au-center-text {
    text-align: center;
}

.au-resend {
    display: flex;
    justify-content: center;
    font-size: 13px;
    color: var(--au-text);
}

.au-resend strong {
    color: var(--au-ink);
    font-variant-numeric: tabular-nums;
}

.au-strength {
    display: flex;
    align-items: center;
    gap: 10px;
}

.au-strength-bars {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.au-strength-bars i {
    height: 4px;
    border-radius: 2px;
    background: #e3e6ec;
}

.au-strength b {
    font-size: 12px;
    font-weight: 700;
    min-width: 48px;
    text-align: right;
}

.au-geo {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border: 1px dashed #d3d8e4;
    border-radius: 12px;
    background: #fafbfd;
}

.au-geo-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.au-geo-head div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.au-geo-btn {
    height: 34px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
}

.au-geo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
    gap: 10px;
}

.au-doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 10px;
}

.au-doc {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--au-line-soft);
    border-radius: 10px;
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.au-doc:hover {
    border-color: #c9cfdd;
    background: #fafbfd;
}

.au-doc span {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.au-doc b {
    font-size: 13.5px;
    font-weight: 600;
}

.au-doc small {
    font-size: 12px;
    color: var(--au-muted);
}

.au-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    color: var(--au-label);
    line-height: 1.55;
    cursor: pointer;
}

.au-check input {
    margin: 3px 0 0;
    width: 16px;
    height: 16px;
    accent-color: var(--au-navy);
    flex: none;
}

.au-badge-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #e8edfb;
    color: var(--au-navy);
    display: flex;
    align-items: center;
    justify-content: center;
}

.au-badge-icon.is-green {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: var(--au-green-tint);
    color: var(--au-green-ink);
}

.au-summary {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--au-line-soft);
    border-radius: 12px;
}

.au-summary div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 16px;
    font-size: 13.5px;
}

.au-summary div + div {
    border-top: 1px solid var(--au-line-soft);
}

.au-summary span {
    color: var(--au-muted);
}

.au-summary b {
    font-weight: 600;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
}

.au-foot {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 20px;
    padding: 0 24px 24px;
    font-size: 12.5px;
    color: var(--au-muted);
}

.au-foot a {
    color: var(--au-text);
    font-weight: 500;
}

/* ---------- terms / privacy dialog ---------- */

.au-legal {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(20, 26, 46, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.au-legal-dialog {
    width: 100%;
    max-width: 760px;
    max-height: min(88vh, 860px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 30px 80px -20px rgba(20, 26, 46, .45);
    overflow: hidden;
}

.au-legal-head {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 18px 28px;
    border-bottom: 1px solid var(--au-line-soft);
}

.au-icon-btn {
    width: 36px;
    height: 36px;
    flex: none;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #4a5170;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.au-icon-btn:hover {
    background: var(--au-tab);
}

.au-legal-body {
    flex: 1;
    overflow-y: auto;
    padding: 28px 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.au-legal-body h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.au-legal-body h3 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
}

.au-legal-body p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: #3a4156;
}

/* the approved Terms / Privacy texts (src/auth/legal/*.md): lists, tables, bold lead-ins, links */
.au-legal-body section > * + * {
    margin-top: 10px;
}

.au-legal-body ul,
.au-legal-body ol {
    margin: 0;
    padding-left: 22px;
    font-size: 14px;
    line-height: 1.7;
    color: #3a4156;
}

.au-legal-body li + li {
    margin-top: 4px;
}

.au-legal-body b {
    color: #1a1f36;
    font-weight: 700;
}

.au-legal-body a {
    color: #1f3a8f;
    text-decoration: underline;
}

.au-legal-table {
    overflow-x: auto;
    border: 1px solid #e3e7f0;
    border-radius: 8px;
}

.au-legal-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    line-height: 1.5;
    color: #3a4156;
}

.au-legal-table th,
.au-legal-table td {
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #e3e7f0;
}

.au-legal-table th {
    background: #f5f7fb;
    color: #1a1f36;
    font-weight: 700;
}

.au-legal-table tr:last-child td {
    border-bottom: 0;
}

.au-legal-foot {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px 20px;
    border-top: 1px solid var(--au-line-soft);
    background: #fafbfd;
}

/* ---------- small screens: the brand panel becomes a top bar ---------- */

@media (max-width: 839px) {
    .au {
        flex-direction: column;
        flex-wrap: nowrap;
    }

    .au-aside {
        flex: none;
        padding: 18px 24px;
    }

    .au-aside-inner {
        position: static;
        min-height: 0;
    }

    .au-aside-body {
        display: none;
    }

    .au-main {
        min-height: 0;
        flex: 1 0 auto;
    }

    .au-center {
        align-items: flex-start;
        padding-bottom: 40px;
    }

    .au-head h1 {
        font-size: 26px;
    }

    .au-legal {
        padding: 12px;
    }

    .au-legal-head {
        padding: 14px 14px 14px 16px;
    }

    .au-legal-body {
        padding: 20px 18px 24px;
    }
}

@media (max-width: 380px) {
    .au-codes {
        gap: 6px;
    }

    .au-code {
        height: 48px;
        font-size: 19px;
    }

    .au-switch {
        white-space: normal;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}
