:root {
    --bg: #f3f0ea;
    --bg-soft: #fbfaf7;
    --card: #ffffff;
    --text: #201a16;
    --muted: #6f6258;
    --primary: #6d1f2f;
    --primary-2: #9f3d4d;
    --primary-hover: #531624;
    --gold: #b78b2f;
    --border: #e8ded2;
    --ok: #116149;
    --danger: #a52822;
    --warning: #8a5f00;
    --shadow: 0 18px 45px rgba(58, 39, 24, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(183, 139, 47, .18), transparent 34rem),
        radial-gradient(circle at top right, rgba(109, 31, 47, .14), transparent 30rem),
        linear-gradient(180deg, #fbfaf7 0%, var(--bg) 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}

a { color: var(--primary); }
.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(232, 222, 210, .85);
}
.topbar-inner {
    min-height: 76px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 900;
    letter-spacing: -.03em;
    font-size: 1.22rem;
}
.brand::before {
    content: "A";
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 10px 24px rgba(109, 31, 47, .25);
}
.tagline {
    color: var(--muted);
    font-weight: 650;
    font-size: .95rem;
}

main { padding: 40px 0 56px; }
.card {
    position: relative;
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(232, 222, 210, .95);
    border-radius: 24px;
    padding: clamp(22px, 4vw, 36px);
    box-shadow: var(--shadow);
    margin-bottom: 22px;
    overflow: hidden;
}
.card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: linear-gradient(180deg, var(--primary), var(--gold));
    opacity: .95;
}
h1, h2, h3 { line-height: 1.12; margin: 0 0 14px; letter-spacing: -.035em; }
h1 { font-size: clamp(2rem, 4vw, 3.15rem); max-width: 900px; }
h2 { font-size: clamp(1.35rem, 2vw, 1.75rem); }
p { margin: 0 0 14px; }
.lead { color: var(--muted); font-size: clamp(1.03rem, 1.5vw, 1.18rem); max-width: 850px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 18px; }
.kpi {
    background: rgba(255, 255, 255, .78);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 10px 26px rgba(58, 39, 24, .06);
}
.kpi h2 { font-size: 1.12rem; margin-bottom: 8px; }
.kpi span { color: var(--muted); font-weight: 750; }
.kpi strong { display: block; font-size: 2.25rem; color: var(--primary); letter-spacing: -.04em; }

.form-group { margin-bottom: 20px; }
label { display: block; font-weight: 850; margin-bottom: 8px; }
input[type="text"], input[type="email"], input[type="password"], textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
    font: inherit;
    background: var(--bg-soft);
    color: var(--text);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, textarea:focus {
    border-color: rgba(109, 31, 47, .45);
    background: white;
    box-shadow: 0 0 0 4px rgba(109, 31, 47, .10);
}
textarea { min-height: 140px; resize: vertical; }
.help, .small { color: var(--muted); font-size: .93rem; }
.help { margin-top: 7px; }

.btn, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 13px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: white;
    text-decoration: none;
    font-weight: 900;
    cursor: pointer;
    font: inherit;
    box-shadow: 0 12px 22px rgba(109, 31, 47, .20);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:hover, button:hover { transform: translateY(-1px); filter: brightness(.98); box-shadow: 0 16px 28px rgba(109, 31, 47, .25); }
.btn-secondary { background: #f1e8de; color: var(--primary); box-shadow: none; }
.btn-secondary:hover { background: #eadccc; }
.btn-danger { background: linear-gradient(135deg, var(--danger), #c43b34); }

.notice {
    border-radius: 18px;
    padding: 15px 17px;
    margin: 18px 0;
    border: 1px solid;
    font-weight: 650;
}
.notice.ok { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.notice.warn { background: #fffbeb; color: var(--warning); border-color: #fde68a; }
.notice.danger { background: #fef2f2; color: var(--danger); border-color: #fecaca; }

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: white;
}
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #faf6ef; color: #4c4038; font-size: .92rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }

.choice-list { display: grid; gap: 12px; margin: 22px 0; }
.choice {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    background: var(--bg-soft);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.choice:hover { border-color: rgba(109, 31, 47, .35); background: white; transform: translateY(-1px); }
.choice input { transform: scale(1.18); accent-color: var(--primary); }

code, .codebox {
    background: #211a17;
    color: #fff8ed;
    padding: 3px 7px;
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .92em;
}
.codebox {
    display: block;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 16px;
    margin: 8px 0 18px;
    border-radius: 16px;
}
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.footer { color: var(--muted); padding: 28px 0; border-top: 1px solid var(--border); }

@media (max-width: 640px) {
    .container { width: min(100% - 22px, 1120px); }
    .topbar-inner { min-height: 68px; align-items: flex-start; padding: 12px 0; }
    .tagline { width: 100%; }
    main { padding-top: 24px; }
    .card { border-radius: 20px; }
    table { min-width: 560px; }
}

.nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.nav a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 850;
    background: #f1e8de;
    padding: 9px 13px;
    border-radius: 999px;
}
.nav a:hover { background: #eadccc; }
.narrow { max-width: 680px; margin-left: auto; margin-right: auto; }
