:root {
    color-scheme: light;
    --paper: #fbf7ef;
    --paper-strong: #fffdf8;
    --ink: #211f1c;
    --muted: #786f63;
    --line: #ded1bf;
    --accent: #126c63;
    --accent-strong: #0b544d;
    --rose: #b75b6a;
    --gold: #c28b2c;
    --danger: #b42318;
    --shadow: 0 24px 70px rgb(57 45 29 / 16%);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(120deg, rgb(18 108 99 / 12%), transparent 34%),
        linear-gradient(240deg, rgb(183 91 106 / 12%), transparent 35%),
        repeating-linear-gradient(0deg, rgb(33 31 28 / 3%) 0 1px, transparent 1px 7px),
        var(--paper);
    color: var(--ink);
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
    font: inherit;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px;
}

.auth-card {
    position: relative;
    display: grid;
    width: min(460px, 100%);
    gap: 22px;
    border: 1px solid color-mix(in srgb, var(--line) 86%, #fff 14%);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgb(255 255 255 / 74%), rgb(255 253 248 / 96%)),
        var(--paper-strong);
    box-shadow: var(--shadow);
    padding: 30px;
}

.auth-card::before {
    position: absolute;
    inset: 12px;
    border: 1px solid rgb(194 139 44 / 18%);
    border-radius: 12px;
    content: "";
    pointer-events: none;
}

.help-button {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fffaf1;
    color: var(--accent);
    cursor: pointer;
    font-weight: 800;
}

.brand-mark {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border: 1px solid #d6b985;
    border-radius: 15px;
    background: #fcf0d9;
    box-shadow: inset 0 -8px 18px rgb(194 139 44 / 15%);
}

.brand-mark span {
    font-size: 28px;
    font-weight: 800;
}

.brand-mark i {
    width: 26px;
    height: 3px;
    border-radius: 999px;
    background: var(--rose);
}

.auth-copy {
    position: relative;
    z-index: 1;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--rose);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

h1 {
    max-width: 340px;
    font-size: clamp(30px, 7vw, 42px);
    line-height: 1.04;
    letter-spacing: 0;
}

.auth-copy p:last-child {
    margin-top: 12px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.login-form {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 14px;
}

.auth-switch {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.auth-switch button {
    min-height: 32px;
    border: 1px solid #f0c7bd;
    border-radius: 999px;
    background: #fff2ec;
    color: var(--rose);
    cursor: pointer;
    font-weight: 900;
    padding: 0 12px;
}

label {
    display: grid;
    gap: 8px;
}

label span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fffdf8;
    color: var(--ink);
    outline: none;
    padding: 10px 12px;
}

input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgb(18 108 99 / 12%);
}

button.primary {
    min-height: 48px;
    border: 1px solid var(--accent);
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
}

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

button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.login-error {
    position: relative;
    z-index: 1;
    min-height: 20px;
    color: var(--danger);
    font-size: 13px;
}

.help-dialog {
    width: min(980px, calc(100vw - 32px));
    max-height: min(780px, calc(100vh - 32px));
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fffdf8;
    color: var(--ink);
    box-shadow: var(--shadow);
    padding: 20px;
}

.help-dialog::backdrop {
    background: rgb(33 31 28 / 42%);
}

.dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.dialog-head h2 {
    font-size: 24px;
}

.dialog-head button {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff7e8;
    color: var(--ink);
    cursor: pointer;
    padding: 0 14px;
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.help-grid section {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fffaf1;
    padding: 14px;
}

.help-grid h3 {
    margin-bottom: 10px;
    font-size: 15px;
}

.help-grid p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

pre {
    overflow: auto;
    margin: 0;
    border-radius: 10px;
    background: #211f1c;
    color: #fff8e8;
    padding: 13px;
    font-size: 12px;
    line-height: 1.5;
}

@media (max-width: 760px) {
    .auth-shell {
        padding: 18px;
    }

    .auth-card {
        padding: 24px;
    }

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