:root {
    --teal: #177577;
    --teal-dark: #0f5557;
    --gold: #e5c96f;
    --gold-soft: #fff8d8;
    --white: #ffffff;
    --ink: #102426;
    --muted: #66777a;
    --line: #dbe8e7;
    --soft: #f6fbfa;
    --shadow: 0 24px 70px rgba(16, 36, 38, 0.12);
    --radius: 24px;
    --radius-sm: 14px;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(229, 201, 111, 0.18), transparent 34rem),
        linear-gradient(180deg, #f7fbfa 0%, #ffffff 46%, #f7fbfa 100%);
    line-height: 1.6;
}

body.admin-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button {
    cursor: pointer;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(23, 117, 119, 0.98), rgba(11, 67, 69, 0.98)),
        radial-gradient(circle at 80% 20%, rgba(229, 201, 111, 0.36), transparent 22rem);
    color: var(--white);
    padding-bottom: 70px;
}

.site-header::after {
    content: "";
    position: absolute;
    inset: auto -10% -55px -10%;
    height: 110px;
    background: var(--white);
    border-radius: 50% 50% 0 0;
}

.topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--gold), #fff2a5);
    color: var(--teal-dark);
    font-weight: 900;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
}

.brand strong,
.brand small {
    display: block;
    line-height: 1.1;
}

.brand small {
    color: rgba(255, 255, 255, 0.72);
    margin-top: 4px;
}

.nav-actions,
.hero-actions,
.action-row,
.download-grid {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
}

.nav-button,
.primary-btn,
.ghost-btn,
.download-btn {
    border: 0;
    border-radius: 999px;
    padding: 12px 20px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.nav-button,
.primary-btn {
    background: linear-gradient(135deg, var(--gold), #fff1a2);
    color: var(--teal-dark);
    box-shadow: 0 14px 26px rgba(229, 201, 111, 0.25);
}

.ghost-btn {
    background: rgba(255, 255, 255, 0.14);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.generator-section .ghost-btn,
.download-btn {
    color: var(--teal-dark);
    background: #eff8f7;
    border: 1px solid var(--line);
}

.primary-btn:hover,
.ghost-btn:hover,
.download-btn:hover,
.nav-button:hover {
    transform: translateY(-2px);
}

.download-btn:disabled,
button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

.hero {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.65fr);
    gap: 42px;
    align-items: center;
    padding: 62px 0 36px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.76rem;
    font-weight: 900;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 4.8rem);
    line-height: 1.02;
    margin: 14px 0 18px;
    letter-spacing: -0.06em;
}

.hero p {
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.08rem;
    max-width: 760px;
}

.hero-card {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--radius);
    padding: 24px;
    backdrop-filter: blur(14px);
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.22);
}

.scan-card {
    display: grid;
    grid-template-columns: 116px 1fr;
    gap: 18px;
    align-items: center;
    background: var(--white);
    color: var(--ink);
    border-radius: 22px;
    padding: 16px;
}

.scan-card small {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

.scan-qr {
    width: 116px;
    aspect-ratio: 1;
    border-radius: 18px;
    background:
        linear-gradient(90deg, var(--teal) 10px, transparent 10px) 0 0 / 24px 24px,
        linear-gradient(var(--teal) 10px, transparent 10px) 0 0 / 24px 24px,
        var(--gold-soft);
    border: 8px solid #ffffff;
    box-shadow: inset 0 0 0 2px rgba(23, 117, 119, 0.12);
}

.hero-list {
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.hero-list li {
    padding: 10px 0 10px 32px;
    position: relative;
    color: rgba(255, 255, 255, 0.86);
}

.hero-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--gold);
    font-weight: 900;
}

.templates-section,
.generator-section,
.features {
    padding: 72px 0 0;
}

.section-heading {
    max-width: 680px;
    margin-bottom: 24px;
}

.section-heading h2,
.panel-title h2,
.preview-header h2 {
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
    margin: 8px 0 8px;
}

.section-heading p,
.field-note,
.output-info,
.features p,
.site-footer p,
.site-footer small {
    color: var(--muted);
}

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

.template-card {
    text-align: left;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 16px 40px rgba(16, 36, 38, 0.06);
    min-height: 150px;
}

.template-card span {
    font-size: 1.8rem;
    display: block;
    margin-bottom: 16px;
}

.template-card strong,
.template-card small {
    display: block;
}

.template-card small {
    color: var(--muted);
    margin-top: 6px;
}

.template-card:hover {
    border-color: rgba(23, 117, 119, 0.45);
    transform: translateY(-2px);
}

.generator-shell {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(340px, 0.7fr);
    gap: 24px;
    align-items: start;
}

.panel {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
}

.switcher {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 8px;
    background: #eef8f7;
    border-radius: 999px;
    margin: 24px 0;
}

.switch-btn {
    border: 0;
    border-radius: 999px;
    padding: 12px 16px;
    color: var(--teal-dark);
    background: transparent;
    font-weight: 900;
}

.switch-btn.active {
    background: var(--white);
    box-shadow: 0 10px 22px rgba(16, 36, 38, 0.08);
}

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.field span {
    color: var(--ink);
    font-weight: 800;
    font-size: 0.9rem;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--ink);
    border-radius: var(--radius-sm);
    padding: 13px 14px;
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
    min-height: 126px;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(23, 117, 119, 0.12);
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.settings-card {
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 18px;
    margin: 10px 0 18px;
}

.settings-card h3 {
    margin: 0 0 12px;
}

.hidden {
    display: none !important;
}

.preview-panel {
    position: sticky;
    top: 18px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: start;
}

.status-pill {
    border-radius: 999px;
    padding: 8px 12px;
    background: var(--gold-soft);
    color: #7a651a;
    font-weight: 900;
    font-size: 0.78rem;
}

.preview-box {
    min-height: 420px;
    display: grid;
    place-items: center;
    border: 1px dashed rgba(23, 117, 119, 0.38);
    background:
        linear-gradient(45deg, rgba(23, 117, 119, 0.035) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(23, 117, 119, 0.035) 25%, transparent 25%),
        #fbffff;
    background-size: 24px 24px;
    border-radius: 22px;
    margin: 22px 0;
    padding: 18px;
    overflow: auto;
}

.preview-box svg,
.preview-box canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

.empty-state {
    text-align: center;
    color: var(--muted);
}

.empty-state strong,
.empty-state small {
    display: block;
}

.empty-icon {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    border-radius: 24px;
    background: var(--gold-soft);
    color: var(--teal);
    font-size: 2rem;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.output-info {
    margin-top: 16px;
    font-size: 0.92rem;
    word-break: break-word;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    padding-bottom: 78px;
}

.features article {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 24px;
    box-shadow: 0 12px 36px rgba(16, 36, 38, 0.06);
}

.features h3 {
    margin-top: 0;
}

.site-footer {
    background: #0f5557;
    color: var(--white);
    padding: 28px 0;
}

.footer-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.site-footer p,
.site-footer small {
    color: rgba(255, 255, 255, 0.72);
}

.admin-card {
    width: min(460px, 100%);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}

.admin-card h1,
.admin-page h1 {
    margin: 0 0 8px;
    letter-spacing: -0.04em;
}

.alert {
    padding: 12px 14px;
    border-radius: 14px;
    margin: 16px 0;
    border: 1px solid var(--line);
}

.alert-error {
    background: #fff1f1;
    color: #9b1c1c;
}

.alert-warning {
    background: var(--gold-soft);
    color: #705b13;
}

.admin-page {
    background: #f7fbfa;
    min-height: 100vh;
}

.admin-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0;
}

.admin-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.table-wrap {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.admin-table th,
.admin-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.admin-table th {
    background: #eff8f7;
    color: var(--teal-dark);
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.admin-table td {
    color: var(--ink);
}

@media print {
    body * {
        visibility: hidden;
    }

    #printArea,
    #printArea * {
        visibility: visible;
    }

    #printArea {
        position: fixed;
        inset: 0;
        display: grid;
        place-items: center;
        background: white;
        padding: 20px;
    }
}

@media (max-width: 980px) {
    .hero,
    .generator-shell,
    .features {
        grid-template-columns: 1fr;
    }

    .template-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .preview-panel {
        position: static;
    }
}

@media (max-width: 680px) {
    .topbar,
    .footer-grid,
    .admin-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero {
        padding-top: 34px;
    }

    .scan-card,
    .two-col,
    .download-grid,
    .template-grid {
        grid-template-columns: 1fr;
    }

    .panel {
        padding: 20px;
    }

    .preview-box {
        min-height: 320px;
    }

    .nav-actions,
    .hero-actions,
    .action-row {
        width: 100%;
    }

    .primary-btn,
    .ghost-btn,
    .nav-button,
    .download-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}
