@font-face {
    font-family: "Roboto";
    src: url("fonts/Roboto-Regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Roboto";
    src: url("fonts/Roboto-Medium.ttf") format("truetype");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Roboto";
    src: url("fonts/Roboto-SemiBold.ttf") format("truetype");
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: "Roboto";
    src: url("fonts/Roboto-Bold.ttf") format("truetype");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: "Roboto";
    src: url("fonts/Roboto-ExtraBold.ttf") format("truetype");
    font-style: normal;
    font-weight: 800;
    font-display: swap;
}

:root {
    --ink: #15231f;
    --muted: #62706b;
    --paper: #ffffff;
    --canvas: #edf1ed;
    --line: #d9e2dc;
    --forest: #173f33;
    --forest-dark: #0d2d24;
    --sage: #dce9df;
    --gold: #c99d4a;
    --success: #18734c;
    --success-soft: #e2f3e9;
    --warning: #9b6716;
    --warning-soft: #fff3d9;
    --danger: #a33737;
    --danger-soft: #fae7e7;
    --radius-lg: 24px;
    --radius-md: 15px;
    --shadow: 0 24px 70px rgba(24, 50, 41, 0.14);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--canvas); }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 10%, rgba(201, 157, 74, 0.13), transparent 30rem),
        linear-gradient(135deg, #f4f1e9 0%, #edf2ed 48%, #e7eee9 100%);
    font-family: "Roboto", Arial, sans-serif;
    line-height: 1.5;
}

button, input { font: inherit; }
button { cursor: pointer; }

.page-shell {
    width: min(100% - 28px, 900px);
    margin: 28px auto;
}

.event-hero {
    position: relative;
    min-height: 290px;
    overflow: hidden;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--forest-dark);
    box-shadow: var(--shadow);
}

.event-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(7, 31, 24, 0.94) 0%, rgba(10, 38, 30, 0.77) 48%, rgba(10, 38, 30, 0.15) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 290px;
    padding: 44px clamp(26px, 7vw, 72px);
    color: #fff;
    flex-direction: column;
    justify-content: flex-end;
}

.event-label, .eyebrow {
    color: var(--gold);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.hero-content h1 {
    max-width: 650px;
    margin: 10px 0 8px;
    font-family: "Roboto", Arial, sans-serif;
    font-size: clamp(1.5rem, 4.5vw, 3rem);
    font-weight: 600;
    line-height: 1.02;
}

.event-date { margin: 8px 0 0; color: #dfe9e3; font-weight: 650; }

.content-card {
    min-height: 360px;
    padding: clamp(24px, 5vw, 48px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--shadow);
}

.login-panel { width: min(100%, 480px); margin: 8px auto; }
.section-heading { margin-bottom: 26px; text-align: center; }
.section-heading.compact { margin-bottom: 20px; text-align: left; }
.section-heading h2, .result-heading h2, .guest-card h2, .empty-state h2, .setup-state h2 {
    margin: 5px 0 7px;
    font-family: "Roboto", Arial, sans-serif;
    font-size: clamp(1.65rem, 4vw, 2.25rem);
    line-height: 1.15;
}
.section-heading p, .empty-state p, .setup-state p { margin: 0; color: var(--muted); }

.stack-form { display: grid; gap: 11px; }
label { font-size: 0.9rem; font-weight: 750; }

input {
    min-width: 0;
    width: 100%;
    height: 50px;
    padding: 0 15px;
    border: 1px solid #cbd7d0;
    border-radius: 12px;
    outline: none;
    color: var(--ink);
    background: #fff;
    transition: border-color 0.18s, box-shadow 0.18s;
}

input:focus {
    border-color: var(--success);
    box-shadow: 0 0 0 4px rgba(24, 115, 76, 0.12);
}

.password-field { position: relative; }
.password-field input { padding-right: 72px; }
.icon-button {
    position: absolute;
    top: 7px;
    right: 7px;
    height: 36px;
    border: 0;
    border-radius: 9px;
    color: var(--forest);
    background: var(--sage);
    font-size: 0.82rem;
    font-weight: 750;
}

.button {
    display: inline-flex;
    min-height: 42px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 11px;
    align-items: center;
    justify-content: center;
    font-weight: 750;
    text-decoration: none;
    transition: transform 0.16s, box-shadow 0.16s, background 0.16s;
}
.button:hover { transform: translateY(-1px); }
.button:focus-visible { outline: 3px solid rgba(201, 157, 74, 0.45); outline-offset: 2px; }
.button-primary { color: #fff; background: var(--forest); box-shadow: 0 8px 18px rgba(23, 63, 51, 0.18); }
.button-primary:hover { background: var(--forest-dark); }
.button-success { color: #fff; background: var(--success); box-shadow: 0 8px 18px rgba(24, 115, 76, 0.2); }
.button-success:hover { background: #105d3d; }
.button-secondary { color: var(--forest); border-color: #bfd0c6; background: #f3f7f4; }
.button-ghost { min-height: 36px; padding: 7px 12px; color: var(--forest); border-color: var(--line); background: #fff; }
.button-large { min-height: 52px; }

.app-toolbar {
    display: flex;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 650;
}
.online-dot { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%; background: #27a66b; box-shadow: 0 0 0 4px #dff3e8; }
.toolbar-actions { display: flex; align-items: center; gap: 9px; }
.toolbar-actions form { margin: 0; }

.statistics-heading { margin-bottom: 26px; }
.statistics-heading h2 {
    margin: 5px 0 7px;
    font-size: clamp(1.65rem, 4vw, 2.25rem);
    line-height: 1.15;
}
.statistics-heading p { margin: 0; color: var(--muted); }
.statistics-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stat-card {
    min-height: 144px;
    padding: 21px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(145deg, #fff, #f5f8f6);
}
.stat-card-accent { border-color: #acd4bc; background: linear-gradient(145deg, #f8fdf9, #e7f5ec); }
.stat-card-warning { border-color: #ead09e; background: linear-gradient(145deg, #fffdf8, #fff2d8); }
.stat-label { display: block; min-height: 42px; color: var(--muted); font-size: 0.86rem; font-weight: 700; }
.stat-value { display: block; margin-top: 8px; color: var(--forest); font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 800; line-height: 1; }
.registration-breakdown { margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--line); }
.registration-heading { margin-bottom: 17px; }
.statistics-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.statistics-table { width: 100%; min-width: 820px; border-collapse: collapse; }
.statistics-table th, .statistics-table td { padding: 15px 17px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.statistics-table th:last-child, .statistics-table td:last-child { border-right: 0; }
.statistics-table tbody tr:last-child th, .statistics-table tbody tr:last-child td { border-bottom: 0; }
.statistics-table thead th { color: #fff; background: var(--forest); font-size: 0.88rem; font-weight: 700; }
.statistics-table tbody th { text-align: left; font-weight: 600; }
.statistics-table tbody tr:nth-child(even):not(.total-row) { background: #f7faf8; }
.statistics-table .total-row { color: var(--forest-dark); background: var(--sage); font-weight: 800; }
.statistics-table .total-row th { font-weight: 800; }

.alert { margin: 0 0 22px; padding: 13px 15px; border: 1px solid; border-radius: 12px; font-weight: 650; }
.alert-success { color: #145f40; border-color: #a8d9bf; background: var(--success-soft); }
.alert-warning { color: #7b5313; border-color: #ead09e; background: var(--warning-soft); }
.alert-error { color: #8e3030; border-color: #e5baba; background: var(--danger-soft); }

.search-section { padding-bottom: 30px; }
.search-tabs { display: grid; margin-bottom: 20px; padding: 4px; border-radius: 13px; background: #edf2ee; grid-template-columns: 1fr 1fr; }
.search-tab { min-height: 44px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-weight: 750; }
.search-tab.is-active { color: var(--forest); background: #fff; box-shadow: 0 4px 14px rgba(28, 59, 49, 0.1); }
.search-form { display: grid; gap: 9px; }
.code-input-row, .phone-input-row, .quantity-row { display: grid; gap: 10px; grid-template-columns: auto minmax(100px, 1fr) auto; }
.phone-input-row { grid-template-columns: minmax(180px, 1fr) auto; }
.code-prefix { display: flex; height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; align-items: center; color: var(--forest); background: #f1f5f2; font-weight: 800; }

.result-section { padding-top: 30px; border-top: 1px solid var(--line); }
.result-heading { display: flex; margin-bottom: 18px; align-items: end; justify-content: space-between; }
.guest-list { display: grid; gap: 10px; }
.guest-list-item { display: flex; width: 100%; padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px; align-items: center; justify-content: space-between; gap: 16px; background: #fff; }
.guest-list-item strong, .guest-list-item span { display: block; }
.guest-list-item span { margin-top: 3px; color: var(--muted); font-size: 0.86rem; }
.list-status { display: flex; align-items: center; gap: 10px; }

.guest-card { padding: clamp(20px, 4vw, 32px); border: 1px solid #cbd8d0; border-radius: 19px; background: linear-gradient(145deg, #fff, #f7faf8); }
.guest-card.checked-in { border-color: #add6bf; background: linear-gradient(145deg, #fff, #eef8f2); }
.guest-card-header { display: flex; padding-bottom: 19px; border-bottom: 1px solid var(--line); align-items: flex-start; justify-content: space-between; gap: 16px; }
.guest-card-header h2 { margin-bottom: 0; }
.badge { display: inline-flex; width: fit-content; padding: 5px 9px; border-radius: 999px; color: #59635f; background: #e9eeeb; white-space: nowrap; font-size: 0.74rem; font-weight: 800; }
.badge-checked { color: #11623f; background: #d7f0e2; }
.badge-pending { color: #7e5918; background: #f8e9c9; }

.guest-details { display: grid; margin: 0; padding: 20px 0 2px; gap: 16px 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.guest-details div { min-width: 0; }
.guest-details dt { color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.guest-details dd { margin: 3px 0 0; overflow-wrap: anywhere; font-weight: 750; }
.checkin-form { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.quantity-row { margin-top: 8px; grid-template-columns: 120px minmax(190px, 1fr); }
.form-hint { margin: 7px 0 0; color: var(--muted); font-size: 0.82rem; }
.checked-message { display: flex; margin-top: 22px; padding: 15px; border-radius: 13px; align-items: center; gap: 12px; color: #145f40; background: var(--success-soft); }
.checked-message strong, .checked-message span { display: block; }
.checked-message span { font-size: 0.84rem; }
.checkmark { display: grid !important; width: 38px; height: 38px; border-radius: 50%; place-items: center; color: #fff; background: var(--success); font-size: 1.25rem !important; }
.next-guest-form { margin-top: 14px; }
.next-guest-form .button { width: 100%; }

.empty-state, .setup-state { padding: 12px 0 28px; text-align: center; }
.status-icon { display: grid; width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%; place-items: center; color: var(--forest); background: var(--sage); font-family: "Roboto", Arial, sans-serif; font-size: 1.8rem; font-weight: 700; }
.walk-in-panel { border: 1px solid var(--line); border-radius: 15px; background: #f8faf8; }
.walk-in-panel summary { padding: 17px 19px; cursor: pointer; color: var(--forest); font-weight: 800; }
.walk-in-panel .stack-form { padding: 2px 19px 20px; }
.setup-state code { padding: 2px 6px; border-radius: 5px; background: #eef1ef; }
.muted { color: var(--muted); }

footer { padding: 18px; color: #718079; text-align: center; font-size: 0.8rem; }
[hidden] { display: none !important; }

@media (max-width: 640px) {
    .page-shell { width: min(100% - 16px, 900px); margin: 8px auto; }
    .event-hero { min-height: 230px; border-radius: 18px 18px 0 0; }
    .hero-content { min-height: 230px; padding: 28px 22px; }
    .content-card { padding: 22px 17px 28px; border-radius: 0 0 18px 18px; }
    .code-input-row { grid-template-columns: auto 1fr; }
    .code-input-row .button { grid-column: 1 / -1; }
    .phone-input-row, .quantity-row { grid-template-columns: 1fr; }
    .guest-list-item, .guest-card-header { align-items: stretch; flex-direction: column; }
    .list-status { justify-content: space-between; }
    .guest-details { grid-template-columns: 1fr 1fr; }
    .app-toolbar { align-items: center; }
    .statistics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .toolbar-actions { align-items: stretch; flex-direction: column; }
    .toolbar-actions .button { min-height: 38px; }
}

@media (max-width: 390px) {
    .guest-details { grid-template-columns: 1fr; }
    .search-tab { font-size: 0.82rem; }
    .statistics-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
