:root {
    --background: #f4f6f8;
    --surface: #ffffff;
    --surface-soft: #eef2f5;
    --text: #182126;
    --muted: #637078;
    --border: #d8e0e5;
    --accent: #0b6b57;
    --accent-dark: #075143;
    --danger: #9f2d2d;
    --warning: #8a5a00;
    --success: #1f6d45;
    --shadow: 0 18px 45px rgba(24, 33, 38, 0.09);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}

button,
input,
textarea,
select {
    font: inherit;
}

a {
    color: var(--accent);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 12px;
    font-size: clamp(2rem, 5vw, 3.7rem);
    line-height: 1.05;
    letter-spacing: -0.045em;
}

h2 {
    margin-bottom: 10px;
    font-size: clamp(1.35rem, 3vw, 2rem);
    letter-spacing: -0.025em;
}

h3 {
    margin-bottom: 8px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 74px;
    padding: 0 5vw;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
}

.brand {
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 800;
    text-decoration: none;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 22px;
}

.topnav a {
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
}

.page-shell {
    width: min(1240px, 92vw);
    margin: 0 auto;
    padding: 48px 0 80px;
}

.footer {
    padding: 24px 5vw 40px;
    color: var(--muted);
    text-align: center;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at top left, rgba(11, 107, 87, 0.2), transparent 35%),
        var(--background);
}

.auth-card {
    width: min(480px, 100%);
    padding: 38px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.wide-card {
    width: min(680px, 100%);
}

.eyebrow {
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.intro {
    max-width: 780px;
    color: var(--muted);
    font-size: 1.08rem;
}

label {
    display: block;
    margin: 18px 0 7px;
    font-weight: 750;
}

input,
textarea,
select {
    width: 100%;
    padding: 12px 14px;
    color: var(--text);
    background: #fff;
    border: 1px solid #bfcbd1;
    border-radius: 11px;
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(11, 107, 87, 0.12);
}

textarea {
    resize: vertical;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    margin-top: 22px;
    padding: 10px 18px;
    color: white;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 11px;
    cursor: pointer;
    font-weight: 800;
    text-decoration: none;
}

.button:hover {
    background: var(--accent-dark);
}

.button.secondary {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
}

.button.small {
    min-height: 38px;
    margin-top: 0;
    padding: 7px 12px;
    font-size: 0.9rem;
}

.button.tiny {
    min-height: 32px;
    margin-top: 0;
    padding: 5px 10px;
    font-size: 0.82rem;
}

.icon-button {
    flex: 0 0 auto;
    padding: 9px 11px;
    color: var(--text);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 750;
}

.password-row,
.secret-row {
    display: flex;
    align-items: center;
    gap: 9px;
}

.field-help {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.alert {
    margin: 20px 0;
    padding: 14px 16px;
    border: 1px solid;
    border-radius: 12px;
}

.alert p:last-child {
    margin-bottom: 0;
}

.alert-error {
    color: var(--danger);
    background: #fff3f3;
    border-color: #efc1c1;
}

.alert-warning {
    color: var(--warning);
    background: #fff8e8;
    border-color: #ecd197;
}

.alert-success {
    color: var(--success);
    background: #effaf3;
    border-color: #b9dfc7;
}

.hero-row,
.project-header,
.section-heading,
.mail-card-heading,
.modal-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
}

.hero-row,
.project-header {
    margin-bottom: 34px;
}

.mail-feature {
    display: flex;
    min-width: 300px;
    align-items: center;
    gap: 14px;
    padding: 18px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-decoration: none;
}

.mail-feature small {
    display: block;
    color: var(--muted);
}

.mail-icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    color: white;
    background: var(--accent);
    border-radius: 12px;
    font-size: 1.35rem;
}

.section-block {
    margin-top: 30px;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.section-block.compact {
    margin-top: 0;
    margin-bottom: 26px;
    padding: 24px;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.project-card {
    display: block;
    padding: 22px;
    color: var(--text);
    background: var(--surface-soft);
    border: 1px solid transparent;
    border-radius: 16px;
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease;
}

.project-card:hover {
    transform: translateY(-3px);
    border-color: #a9bab3;
}

.project-card-top,
.metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.project-arrow {
    font-size: 1.4rem;
}

.domain-name {
    color: var(--accent);
    font-weight: 800;
}

.domain-name.large {
    font-size: 1.15rem;
}

.status-badge {
    display: inline-flex;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
}

.status-active {
    color: #145c3c;
    background: #dff4e8;
}

.status-draft {
    color: #5c6570;
    background: #e7ebee;
}

.status-paused {
    color: #7b4d00;
    background: #fff0ca;
}

.status-completed {
    color: #184d7a;
    background: #dceeff;
}

.metric-row {
    flex-wrap: wrap;
    margin-top: 24px;
    padding-top: 16px;
    color: var(--muted);
    border-top: 1px solid var(--border);
    font-size: 0.88rem;
}

.metric-row strong {
    color: var(--text);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 26px 0;
}

.summary-card {
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 15px;
}

.summary-card span {
    display: block;
    color: var(--muted);
}

.summary-card strong {
    display: block;
    margin-top: 8px;
    font-size: 2rem;
}

.two-column-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
    gap: 26px;
}

.sticky-card {
    position: sticky;
    top: 98px;
}

.step-list,
.code-list,
.vault-list,
.mail-list {
    display: grid;
    gap: 13px;
    margin-top: 20px;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    padding: 14px;
    text-align: left;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 13px;
}

.step-item h3,
.step-item p {
    margin-bottom: 4px;
}

.step-item.is-complete h3 {
    color: var(--muted);
    text-decoration: line-through;
}

.check-button {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    color: white;
    background: var(--accent);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 800;
}

.code-card,
.vault-card,
.mail-card {
    padding: 16px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 13px;
}

.code-card summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    cursor: pointer;
}

.code-card summary span:first-child {
    display: grid;
}

.code-card small {
    color: var(--muted);
}

.code-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

pre {
    max-height: 620px;
    overflow: auto;
    margin: 12px 0 0;
    padding: 16px;
    color: #e8f2ed;
    background: #17211e;
    border-radius: 12px;
    white-space: pre;
    tab-size: 4;
}

code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.vault-card label {
    margin-top: 13px;
    font-size: 0.85rem;
}

.vault-notes {
    margin: 14px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.strength {
    margin: 7px 0 0;
    font-size: 0.82rem;
    font-weight: 800;
}

.strength-4 {
    color: var(--success);
}

.strength-3 {
    color: var(--warning);
}

.strength-0,
.strength-1,
.strength-2 {
    color: var(--danger);
}

.password-check {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.88rem;
}

.password-check[data-score="4"] {
    color: var(--success);
}

.password-check[data-score="3"] {
    color: var(--warning);
}

.password-check[data-score="0"],
.password-check[data-score="1"],
.password-check[data-score="2"] {
    color: var(--danger);
}

.mail-card.is-unread {
    background: #eefaf6;
    border-left: 5px solid var(--accent);
}

.mail-card-heading time {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.88rem;
}

.empty-state {
    padding: 34px;
    color: var(--muted);
    background: var(--surface-soft);
    border: 1px dashed #b8c3c9;
    border-radius: 14px;
    text-align: center;
}

.small-empty {
    margin-top: 18px;
    padding: 20px;
}

.back-link,
.text-link {
    display: inline-block;
    margin-bottom: 24px;
    font-weight: 800;
    text-decoration: none;
}

.modal {
    width: min(600px, calc(100vw - 28px));
    max-height: 90vh;
    padding: 0;
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.large-modal {
    width: min(900px, calc(100vw - 28px));
}

.modal::backdrop {
    background: rgba(13, 20, 24, 0.64);
}

.modal form {
    padding: 26px;
}

.code-input {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    line-height: 1.45;
}

.setup-secret {
    padding: 20px;
    background: var(--surface-soft);
    border-radius: 14px;
}

.setup-secret dl {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 9px 16px;
}

.setup-secret dt {
    font-weight: 800;
}

.setup-secret dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.warning-text {
    color: var(--danger);
    font-weight: 800;
}

.totp-input {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.28em;
    text-align: center;
}

@media (max-width: 900px) {
    .hero-row,
    .project-header {
        display: grid;
    }

    .mail-feature {
        min-width: 0;
    }

    .two-column-layout {
        grid-template-columns: 1fr;
    }

    .sticky-card {
        position: static;
    }
}

@media (max-width: 640px) {
    .topbar {
        padding: 0 20px;
    }

    .topnav {
        gap: 12px;
        font-size: 0.9rem;
    }

    .page-shell {
        width: min(94vw, 1240px);
        padding-top: 30px;
    }

    .auth-card,
    .section-block {
        padding: 22px;
    }

    .hero-row,
    .section-heading,
    .mail-card-heading,
    .modal-heading {
        display: grid;
        gap: 14px;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .metric-row {
        justify-content: flex-start;
    }

    .setup-secret dl {
        grid-template-columns: 1fr;
    }

    .password-row,
    .secret-row {
        align-items: stretch;
        flex-direction: column;
    }
}
