:root {
  --blue: #063d8f;
  --blue-dark: #042a64;
  --red: #ef0925;
  --ink: #15233a;
  --muted: #66748a;
  --line: #d9e2ef;
  --paper: #ffffff;
  --background: #f4f7fb;
  --green: #06734b;
  --green-pale: #e4f5ed;
  --red-pale: #fff0f1;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; color: var(--ink); background: var(--background); font-family: 'DM Sans', Arial, sans-serif; line-height: 1.5; }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: Manrope, Arial, sans-serif; letter-spacing: 0; line-height: 1.1; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .7; }
[hidden] { display: none !important; }

.public-page { min-height: 100vh; overflow-x: hidden; background: #f4f7fb; }
.site-shell { width: min(100% - 40px, 1080px); margin: 0 auto; padding: 24px 0 16px; position: relative; }
.brand-header { display: flex; justify-content: center; padding: 0 0 20px; }
.logo { display: block; width: min(100%, 510px); height: auto; }
.intro { padding: 20px 0 18px; position: relative; }
.eyebrow { color: var(--red); font-size: .73rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 12px; }
.intro h1 { color: var(--blue-dark); font-size: clamp(2rem, 3.6vw, 3.7rem); margin-bottom: 12px; white-space: nowrap; }
.intro-copy { color: var(--muted); font-size: 1.05rem; margin-bottom: 17px; }
.event-date { align-items: center; border-left: 4px solid var(--red); display: flex; gap: 15px; padding-left: 14px; color: var(--blue-dark); }
.date-day { font-family: Manrope, Arial, sans-serif; font-size: 2.5rem; font-weight: 800; line-height: 1; }
.event-date strong, .event-date small { display: block; }
.event-date small { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.form-panel { background: var(--paper); border-top: 6px solid var(--blue); box-shadow: 0 18px 50px rgba(6, 61, 143, .1); margin: 12px 0 20px; padding: clamp(24px, 3.5vw, 34px); position: relative; }
.form-panel::after { border-color: transparent var(--red) transparent transparent; border-style: solid; border-width: 0 26px 26px 0; content: ''; height: 0; position: absolute; right: 0; top: 0; width: 0; }
.panel-heading, .dashboard-heading, .list-heading { align-items: flex-start; display: flex; justify-content: space-between; gap: 24px; }
.panel-heading h2 { color: var(--blue-dark); font-size: clamp(1.65rem, 3vw, 2.2rem); margin-bottom: 0; }
.step-label { color: var(--red); font-weight: 700; font-size: .85rem; white-space: nowrap; }
.form-note { color: var(--muted); font-size: .92rem; margin: 8px 0 18px; }
.field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.field-wide { grid-column: auto; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span, legend { color: var(--ink); font-size: .87rem; font-weight: 700; }
input[type='text'], input[type='email'], input[type='password'] { background: #fbfcfe; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); min-height: 50px; outline: none; padding: 12px 14px; transition: border-color .15s, box-shadow .15s; width: 100%; }
input::placeholder { color: #9aa6b6; }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(6, 61, 143, .12); }
.attendance-fieldset { border: 0; margin: 20px 0 0; padding: 0; }
.attendance-fieldset legend { margin-bottom: 13px; padding: 0; }
.attendance-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.attendance-option { display: block; position: relative; }
.attendance-option input { opacity: 0; position: absolute; }
.attendance-card { background: #fbfcfe; border: 1px solid var(--line); border-radius: 4px; display: block; min-height: 82px; padding: 17px 18px 15px 46px; position: relative; transition: border-color .15s, background .15s; }
.attendance-card::before { border: 2px solid #aab8cb; border-radius: 50%; content: ''; height: 17px; left: 18px; position: absolute; top: 20px; width: 17px; }
.attendance-card::after { background: var(--blue); border-radius: 50%; content: ''; height: 9px; left: 22px; opacity: 0; position: absolute; top: 24px; transform: scale(.5); transition: opacity .15s, transform .15s; width: 9px; }
.attendance-option input:checked + .attendance-card { background: #f1f6ff; border-color: var(--blue); }
.attendance-option input:checked + .attendance-card::after { opacity: 1; transform: scale(1); }
.attendance-card strong, .attendance-card small { display: block; }
.attendance-card strong { font-size: .92rem; }
.attendance-card small { color: var(--muted); font-size: .78rem; margin-top: 3px; }
.form-message { min-height: 24px; font-size: .9rem; margin: 18px 0 4px; }
.form-message.success { color: var(--green); }
.form-message.error { color: var(--red); }
.registration-confirmation { padding: 18px 0 8px; outline: none; }
.confirmation-mark { align-items: center; background: var(--green-pale); border: 1px solid #a7dec5; border-radius: 50%; color: var(--green); display: flex; font-size: 1.4rem; font-weight: 700; height: 54px; justify-content: center; margin-bottom: 22px; width: 54px; }
.registration-confirmation h2 { color: var(--blue-dark); font-size: clamp(1.7rem, 3vw, 2.4rem); margin-bottom: 12px; }
.registration-confirmation p:last-child { color: var(--muted); margin-bottom: 0; max-width: 560px; }
.primary-button { align-items: center; background: var(--blue); border: 0; border-radius: 4px; color: #fff; display: flex; font-weight: 700; gap: 18px; justify-content: space-between; margin-top: 4px; min-height: 52px; padding: 12px 18px; transition: background .15s, transform .15s; }
.primary-button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.site-footer { align-items: center; color: var(--muted); display: flex; font-size: .77rem; justify-content: space-between; padding: 0 4px; }
.site-footer a, .back-link { color: var(--blue); font-weight: 700; text-decoration: none; }
.site-footer a:hover, .back-link:hover { text-decoration: underline; }
.confetti { height: 100px; opacity: .75; position: absolute; width: 100px; }
.confetti-one { border-left: 5px solid var(--red); border-top: 5px solid var(--blue); right: -72px; top: 210px; transform: rotate(24deg); }
.confetti-two { border-bottom: 5px solid var(--blue); border-right: 5px solid var(--red); left: -72px; top: 570px; transform: rotate(24deg); }

.admin-page { background: var(--background); min-height: 100vh; }
.admin-shell { margin: 0 auto; max-width: 1160px; padding: 28px 20px 60px; }
.admin-header { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding-bottom: 20px; }
.back-link { font-size: .88rem; }
.admin-logo { height: auto; max-width: 220px; }
.login-view { background: #fff; border-top: 5px solid var(--blue); box-shadow: 0 18px 50px rgba(6, 61, 143, .08); margin: 85px auto; max-width: 500px; padding: 42px; }
.login-view h1, .dashboard-heading h1 { color: var(--blue-dark); font-size: clamp(1.8rem, 4vw, 2.7rem); margin-bottom: 12px; }
.login-view p:not(.eyebrow) { color: var(--muted); margin-bottom: 28px; }
.login-form .primary-button { width: 100%; }
.dashboard-view { padding-top: 48px; }
.text-button { background: transparent; border: 0; color: var(--blue); font-weight: 700; padding: 8px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 34px 0 45px; }
.stat { background: #fff; border-left: 5px solid var(--blue); padding: 20px 24px; }
.stat-highlight { border-left-color: var(--red); }
.stat span { color: var(--muted); display: block; font-size: .88rem; }
.stat strong { color: var(--blue-dark); display: block; font-family: Manrope, Arial, sans-serif; font-size: 2.5rem; line-height: 1.2; margin-top: 6px; }
.list-heading { align-items: end; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.list-heading h2 { color: var(--blue-dark); font-size: 1.35rem; margin-bottom: 3px; }
.list-heading p { color: var(--muted); font-size: .84rem; margin: 0; }
.danger-button { background: transparent; border: 1px solid #d9a0a5; border-radius: 4px; color: var(--red); font-size: .82rem; font-weight: 700; padding: 10px 13px; }
.danger-button:hover { background: var(--red-pale); }
.table-wrap { background: #fff; overflow-x: auto; }
table { border-collapse: collapse; min-width: 760px; width: 100%; }
th, td { border-bottom: 1px solid #e8edf4; padding: 15px 16px; text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
td { color: #35445a; font-size: .88rem; }
td strong { color: var(--ink); }
.status { border-radius: 999px; display: inline-block; font-size: .75rem; font-weight: 700; padding: 4px 9px; }
.status-yes { background: var(--green-pale); color: var(--green); }
.status-no { background: var(--red-pale); color: #ad2736; }
.empty-state { color: var(--muted); padding: 40px 16px; text-align: center; }

@media (max-width: 900px) and (min-width: 641px) {
  .intro h1 { white-space: normal; }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .site-shell { width: min(100% - 28px, 1080px); padding-top: 24px; }
  .brand-header { padding-bottom: 22px; }
  .logo { width: 100%; }
  .intro { padding-top: 25px; }
  .intro h1 { white-space: normal; }
  .field-grid, .attendance-options, .stats-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .form-panel { padding: 25px 20px; }
  .panel-heading, .dashboard-heading, .list-heading, .site-footer { align-items: flex-start; flex-direction: column; gap: 12px; }
  .step-label { display: none; }
  .site-footer { gap: 8px; }
  .confetti { display: none; }
  .admin-shell { padding: 20px 14px 40px; }
  .admin-logo { max-width: 155px; }
  .login-view { margin: 50px auto; padding: 28px 22px; }
  .dashboard-view { padding-top: 35px; }
  .dashboard-heading { gap: 2px; }
}
