:root {
    --bg0: #101814;
    --bg1: #17241c;
    --surface: rgba(220, 245, 230, 0.06);
    --line: rgba(160, 210, 175, 0.2);
    --text: #eef7f1;
    --muted: #9fb8a8;
    --accent: #3d9b6a;
    --accent-deep: #2a704c;
    --radius: 18px;
    --control-bg: rgba(0, 0, 0, 0.28);
    --font: "Segoe UI", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html {
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(900px 500px at 10% -10%, rgba(61, 155, 106, 0.3), transparent 60%),
        radial-gradient(700px 420px at 100% 0%, rgba(30, 80, 50, 0.4), transparent 55%),
        linear-gradient(165deg, var(--bg1), var(--bg0) 55%, #0a100d);
}

.page {
    width: min(560px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2.5rem 0 3rem;
    display: grid;
    gap: 1.1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.brand img {
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(61, 155, 106, 0.4);
}
.brand-home {
    display: block;
    line-height: 0;
    border-radius: 50%;
    text-decoration: none;
}

.brand-home:hover img {
    filter: brightness(1.08);
}

.brand-home:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.brand-name {
    margin: 0;
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
}

h1 {
    margin: 0.15rem 0 0;
    font-size: clamp(1.6rem, 4vw, 2.1rem);
    font-weight: 650;
    letter-spacing: -0.02em;
}

.lede {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.field-caption {
    white-space: nowrap;
}

.optional {
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.hint {
    margin: -0.55rem 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.field {
    display: grid;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.field-full {
    width: 100%;
}

.field textarea,
.field input[type="text"],
.field select,
.file-control {
    appearance: none;
    -webkit-appearance: none;
    color-scheme: dark;
    width: 100%;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text);
    background-color: var(--control-bg);
    background-image: none;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.7rem 0.85rem;
}

.field textarea {
    resize: vertical;
    min-height: 88px;
    font-size: 1.02rem;
    line-height: 1.45;
    border-radius: 14px;
    padding: 0.85rem 1rem;
}

.field textarea:focus,
.field input[type="text"]:focus,
.field select:focus,
.file-control:focus-within {
    outline: none;
    border-color: var(--accent);
}

.field input[type="text"]:-webkit-autofill,
.field input[type="text"]:-webkit-autofill:hover,
.field input[type="text"]:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    caret-color: var(--text);
    box-shadow: 0 0 0 1000px #141c18 inset;
    transition: background-color 9999s ease-out;
}

.file-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.file-control {
    display: flex;
    align-items: center;
    cursor: pointer;
    min-height: 46px;
}

.file-control input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.file-row .btn {
    flex: 0 0 auto;
}

.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 0.65rem 1.15rem;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    color: #0a100d;
    background: linear-gradient(180deg, #55b882, var(--accent-deep));
}

.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }

.btn.secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--line);
}

.status {
    margin: 0;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.status.is-error {
    border-color: rgba(224, 122, 106, 0.45);
    background: rgba(224, 122, 106, 0.12);
    color: #f2c2ba;
}

.status.is-ok {
    border-color: rgba(125, 190, 116, 0.4);
    background: rgba(125, 190, 116, 0.1);
    color: #c8e4c3;
}

.qr-stage {
    display: none;
    place-items: center;
    padding: 1.25rem 1.25rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: #fff;
}

.qr-stage.is-ready {
    display: grid;
}

.qr-stage canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.foot {
    margin-top: 0.5rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.foot a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.foot a:hover {
    color: var(--text);
    border-bottom-color: var(--accent);
}

@media (max-width: 560px) {
    .controls { grid-template-columns: 1fr; }
    .page { padding-top: 1.5rem; }
    .file-row { flex-direction: column; }
}
