/* ============================================================================
   register.html: full width, and which surfaces are glass.

   The recipe lives in glass.css, which must be loaded before this. Loaded last
   so it can restyle register.css and register-3d.css without rewriting them.
   Remove the one <link> and the page returns to what it was.

   Everything is scoped to #register because .register-panel, .field and
   .form-grid are shared with /admin, which must not change.
   ========================================================================= */

/* ---------- 1. Full page width -------------------------------------------
   The page sat in an 1180px container holding a layout capped at 1080px, under
   a footer already spanning calc(100% - 48px). Both caps go so the page lines
   up with the footer, same as sponsor.html.
   Above 1240px only, so laptops and phones keep the layout they have. */
@media (min-width: 1240px) {
  #register > .container { max-width: none; width: calc(100% - 48px); }
  #register .reg-layout { max-width: none; }
}

/* A form is not an article: width that helps a paragraph hurts a text box. Left to grow, the name
   field would have been about 700px on a 2560px monitor, which is a long way for the eye to travel
   back from the end of what you typed. The panel and the ticket take the full width, the controls
   inside stop at a size you can actually scan. The cap is per field, not on the grid, so the two
   columns stay where they are and the labels stay left aligned under each other. */
@media (min-width: 1240px) {
  /* Single line entries: a name or an email is short, and a box wider than this is just a long way
     for the eye to travel back from what you typed. At 1600px the two column grid already hands each
     field about 400px, so this only starts to bite past roughly 2000px. */
  #register .field input,
  #register .field select { max-width: 560px; }
  /* The textarea and the button are different. A textarea holds several lines so width genuinely
     helps, and a primary call to action wants to be substantial. Capping these at 560 left a visible
     dead strip down the right of the panel at ordinary laptop widths. They fill the panel instead,
     with a generous ceiling so a very wide monitor does not produce a 1500px button. */
  #register #registerForm textarea,
  #register #registerForm button[type="submit"],
  #register .privacy-note { max-width: 1000px; }
  #register .privacy-note { text-align: left; }
}

/* ---------- 2. Glass -----------------------------------------------------
   register-3d.css already made the form panel half glass with its own gradient
   and a 10px blur. That is replaced here rather than layered on, so the two
   pages match. The turning light around the panel edge is kept: it is the best
   thing on this page and it survives untouched. */
#register .reg-ticket,
#register.r3 .register-panel,
#register .register-panel,
#register .register-success {
  background: var(--g-grain), var(--g-sheen), var(--g-fill);
  -webkit-backdrop-filter: var(--g-blur);
  backdrop-filter: var(--g-blur);
  border: 1px solid var(--g-edge);
  box-shadow: inset 0 1px 0 var(--g-rim), inset 0 -1px 0 var(--g-rim-lo), var(--g-cast);
}

/* The ticket keeps its blue identity as a tint over the glass, not as a solid fill. */
#register .reg-ticket {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--g-edge));
}
#register .reg-ticket > .reg-ticket-top { position: relative; }

/* The lit top edge: a real sheet catches light along its upper border and loses it toward the
   middle, which a flat 1px border cannot do. */
#register .reg-ticket::before,
#register .register-panel::after {
  content: ""; position: absolute; left: 12%; right: 12%; top: -1px; height: 1px; z-index: 3;
  pointer-events: none; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
}
/* register.css used .reg-ticket::before for the light sweep and register-3d.css uses ::after for the
   hologram, so the sweep is rebuilt on a wrapper instead of being silently dropped. */
#register .reg-ticket-top::before {
  content: ""; position: absolute; inset: -40% -60%; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 42%, color-mix(in srgb, var(--accent-2) 14%, transparent) 50%, transparent 58%);
  animation: reg-sweep 7s ease-in-out infinite;
}

/* Nested panes: the time boxes, the countdown digits and the interest chips sit on a pane that is
   already blurred, so they stay lighter and skip the second blur. */
#register .reg-times div,
#register .reg-cd div,
#register .lr-interests label {
  background: var(--g-sheen), var(--g-fill-2);
  border: 1px solid var(--g-edge);
  box-shadow: inset 0 1px 0 var(--g-rim);
}
#register .reg-cd div { border-color: color-mix(in srgb, var(--accent) 26%, var(--g-edge)); }
/* A chosen chip is a filled control, not glass: it has to stay obviously on. */
#register .lr-interests label:has(input:checked) {
  background: var(--accent); border-color: var(--accent); box-shadow: none;
}

/* Inputs read as recessed glass: darker than the pane, same lit top edge. */
#register .field input,
#register .field select,
#register .field textarea {
  background: color-mix(in srgb, var(--g-fill) 72%, transparent) !important;
  border: 1px solid var(--g-edge) !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.20);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
#register .field input:focus,
#register .field select:focus,
#register .field textarea:focus {
  border-color: color-mix(in srgb, var(--accent-2) 70%, transparent) !important;
}
/* A finished field still has to read as finished through the glass. */
#register .field.is-done input,
#register .field.is-done select {
  border-color: color-mix(in srgb, var(--success) 60%, var(--g-edge)) !important;
}

/* The tear line punches two holes in the ticket. Giving them the page background plus a hairline
   makes them read as real cut-outs rather than two dark dots. */
#register .reg-perf::before,
#register .reg-perf::after {
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--g-edge);
}

/* ---------- 3. Text: one row where it fits, two where it does not -------- */
#register .section-head h1,
#register .reg-ticket-date,
#register .reg-ticket-kicker,
#register .section-head > p,
#register .reg-gets li { text-wrap: balance; }
#register .section-head > p, #register .reg-gets li { text-wrap: pretty; }

/* Short labels that now have the room. Guarded at the width the page goes full width, so a narrow
   window is still free to wrap rather than overflow. */
@media (min-width: 1240px) {
  #register .reg-ticket-kicker,
  #register .reg-ticket-date,
  #register .reg-times dt,
  #register .reg-times dd,
  #register .reg-cd span,
  #register .reg-gets li,
  #register .reg-count,
  #register .reg-progress-text,
  #register .field > label { white-space: nowrap; }
}

/* ---------- 4. When glass is the wrong answer ---------------------------- */
@media (prefers-reduced-transparency: reduce) {
  #register .reg-ticket,
  #register.r3 .register-panel,
  #register .register-panel,
  #register .register-success {
    background: var(--surface) !important;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #register .reg-ticket,
  #register.r3 .register-panel,
  #register .register-panel,
  #register .register-success { background: var(--surface) !important; }
}
@media (prefers-reduced-motion: reduce) {
  #register .reg-ticket-top::before { animation: none; }
}
html.lite #register .reg-ticket-top::before { animation: none; }
