/* Shared Feast CDO portal theme */
:root {
  --feast-red: #b7192b;
  --feast-charcoal: #17171a;
  --feast-canvas: #eeeef0;
  --feast-panel: linear-gradient(145deg, #fff 0, #fafafb 58%, #f0f0f2);
  --feast-edge: 1px solid #ffffffd9;
  --feast-radius: 22px;
  --feast-depth: inset 1px 1px 1px white, inset -1px -1px 2px #17171a0b,
    2px 3px 4px #2020240a, 7px 12px 23px -8px #27272e38;
  --feast-inset: inset 2px 3px 5px #17171a0e, 0 1px 0 white;
  --feast-key: inset 0 1px 1px #ffffff70, 0 2px 2px #57101b2b, 2px 6px 12px #82132626;
}

body { background-color: var(--feast-canvas); }

:is(#loginView, #auth) {
  isolation: isolate;
  gap: clamp(24px, 4vw, 76px);
  padding: clamp(24px, 3vw, 56px);
  align-items: center;
  background: radial-gradient(ellipse at 20% 8%, white, transparent 58%), var(--feast-canvas);
}
:is(#loginView .brand-panel, #auth .hero) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  align-self: stretch;
  min-width: 0;
  padding: clamp(34px, 4.6vw, 84px);
  border: 1px solid #3d373b;
  border-radius: clamp(28px, 3.5vw, 54px);
  background: linear-gradient(135deg, #373035, #232124 45%, var(--feast-charcoal));
  box-shadow: inset 1px 1px 1px #ffffff26, 6px 14px 26px -9px #17171a55;
}
:is(#loginView .brand-panel, #auth .hero) > div {
  position: relative;
  z-index: 1;
}
/* A red folded plane and two cast discs echo the relief in the reference. */
:is(#loginView .brand-panel, #auth .hero)::before,
:is(#appView .hero-card, #portal .welcome, #portal .dream-hero)::before {
  content: "";
  position: absolute;
  pointer-events: none;
  width: 64%;
  height: 58%;
  right: -33%;
  top: -29%;
  border-radius: 28%;
  transform: rotate(-34deg);
  background: linear-gradient(130deg, #d84e5c, #b7192b 48%, #831423);
  box-shadow: inset 1px 2px 2px #ffffff48, -7px 14px 24px #110b1045;
}
:is(#loginView .brand-panel, #auth .hero)::after {
  content: "";
  position: absolute;
  pointer-events: none;
  width: clamp(62px, 8vw, 128px);
  aspect-ratio: 1;
  right: 7%;
  bottom: 5%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 22%, #575057, #343034 58%, #252326 85%);
  box-shadow: inset 1px 1px 2px #ffffff36, 5px 10px 14px #0005;
}
:is(.brand-panel, #auth .hero) h1 { max-width: 13ch; text-wrap: balance; }
:is(.brand-panel, #auth .hero) p { max-width: 47ch; color: #e1dfe2; }
:is(.brand-panel, #auth .hero) b { font-size: .76rem; letter-spacing: .1em; }
:is(#loginView .brand-panel, #auth .hero) .eyebrow { color: #ffb7bf; letter-spacing: .13em; }
:is(#loginView .login-card, #auth > .card, #accessLoading, main:has(> .mark)) {
  background: var(--feast-panel);
  border: var(--feast-edge);
  border-radius: 30px;
  box-shadow: var(--feast-depth);
  padding: clamp(24px, 3.25vw, 52px);
}
:is(#loginView .login-card, #auth > .card) { width: min(100%, 560px); margin: 16px auto; }
#loginView .login-card .eyebrow { font-size: .76rem; color: var(--feast-red) !important; }
#auth .tabs { gap: 4px; padding: 5px; background: #e9e9ec; border-radius: 999px; box-shadow: var(--feast-inset); }
#auth .tab { border-radius: 999px; min-height: 42px; }
#auth .tab.on { color: #991529; background: var(--feast-panel); box-shadow: 1px 3px 6px #17171a24; }

:is(#loginView, #auth, #appView, #portal) :is(input:not([type=checkbox],[type=radio],[type=file],[type=hidden],[type=range],[type=color],[type=button],[type=submit]), textarea, select) {
  min-width: 0;
  border: 1px solid #d1d1d6;
  border-radius: 13px;
  background-color: #fafafb;
  box-shadow: var(--feast-inset);
}
:is(#loginView, #auth) :is(input, select) { min-height: 46px; }
:is(#loginView .primary, #auth .btn, #appView .primary, #portal .btn, main:has(> .mark) .actions a) {
  border-radius: 999px;
  color: white;
  background: linear-gradient(155deg, #ca293d, #a61528);
  box-shadow: var(--feast-key);
}
:is(#appView .secondary, #appView .control-shortcut, #appView button.btn:not(.primary,.secondary)) {
  border-radius: 16px;
  box-shadow: 1px 3px 7px #17171a12, inset 0 1px 1px #ffffff6b;
}
:is(#loginView, #auth, #appView, #portal) :is(.primary, .btn, .tab):active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: inset 1px 2px 4px #17171a24;
}
:is(#auth, #loginView, #portal, #appView) :is(button, a, select, textarea, input):focus-visible {
  outline: 3px solid var(--feast-red); outline-offset: 3px;
}
:is(.sidebar, .side) .nav :focus-visible { outline-color: white !important; }

:is(#appView, #portal) { background: var(--feast-canvas); }
:is(#appView .card, #portal .box, #appView .modal-card) {
  border: var(--feast-edge);
  border-radius: var(--feast-radius);
  background: var(--feast-panel);
  box-shadow: var(--feast-depth);
}
:is(#appView .card .card, #portal .box .box) { box-shadow: inset 0 1px 0 white, 0 2px 5px #17171a0b; }
:is(#appView .hero-card, #portal .welcome, #portal .dream-hero) {
  position: relative; isolation: isolate; overflow: hidden;
  background: linear-gradient(125deg, #831323, #b7192b 62%, #c73547);
  border-radius: var(--feast-radius); box-shadow: var(--feast-key);
}
:is(#appView .hero-card, #portal .welcome, #portal .dream-hero)::before {
  height: 290%; width: 34%; top: -145%; right: -11%; z-index: -1;
}
#portal .welcome .idbox { border-radius: 16px; background: #68101f7a; box-shadow: inset 1px 2px 4px #470a1622; }
:is(#appView .stats > article, #portal .stats > .stat, #appView .event-registration-stats > article) {
  min-width: 0; overflow-wrap: anywhere;
  padding: clamp(16px, 1.5vw, 24px);
  background: var(--feast-panel); border: var(--feast-edge);
  border-radius: var(--feast-radius); box-shadow: var(--feast-depth);
}
:is(#appView .stats, #portal .stats) strong { color: var(--feast-red); font-variant-numeric: tabular-nums; }
:is(#appView .stats, #portal .stats) small { color: #5f5f68; }
:is(#appView .scorecard-grid article, #portal .magic > div, #portal .dream-item) {
  border-radius: 16px;
  box-shadow: inset 0 1px 0 #fff, 1px 3px 6px #17171a0d;
}
:is(#appView .sidebar, #portal .side) .nav :is(button.active, button.on) {
  border-radius: 15px; box-shadow: inset 3px 0 #de4052, inset 0 1px 1px #ffffff19;
}
main:has(> .mark) .mark {
  display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 24px;
  border-radius: 50%; color: var(--feast-red); background: var(--feast-panel); box-shadow: var(--feast-depth);
}

@media (max-width: 900px) {
  #loginView:not(.hide), #auth:not(.hide) { grid-template-columns: minmax(0,1fr); align-content: start; gap: 18px; padding: 16px; }
  :is(#loginView .brand-panel, #auth .hero) { padding: 32px 26px; border-radius: 24px; }
  :is(#loginView .brand-panel, #auth .hero)::after { width: 44px; right: 6%; bottom: 6%; opacity: .5; }
  :is(#loginView .login-card, #auth > .card) { margin: 0 auto 16px; border-radius: 24px; }
  :is(.brand-panel, #auth .hero) h1 { font-size: clamp(32px, 6.8vw, 52px); }
  #loginView .feast-portal-logo { max-width: min(168px, 60%); margin-bottom: 12px; }
  .portal .main, .two > *, .portal .welcome > * { min-width: 0; }
}
@media (max-width: 560px) {
  :is(#appView, #portal) .stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  :is(#appView .stats > article, #portal .stats > .stat) { padding: 14px; border-radius: 17px; }
  :is(#appView .stats, #portal .stat) strong { font-size: clamp(20px,5.5vw,28px); }
  #portal .welcome { gap: 12px; flex-wrap: wrap; }
  #auth .grid { grid-template-columns: minmax(0,1fr); }
  #auth .grid .wide { grid-column: 1 / -1; }
}
@media print {
  :is(#appView .card, #portal .box, #appView .stats > article, #portal .stat) { box-shadow: none; background: white; }
}

/* Frosted surfaces retain a solid base when transparency is reduced. */
:root {
  --feast-panel: linear-gradient(140deg, #ffffffed, #ffffffba 60%, #f4f4f8a8);
  --nav-face: linear-gradient(150deg, #ffffff17, #ffffff09 70%);
  --nav-rim: 0 1px 1px #0004, 0 3px 6px #0002, inset 0 1px 0 #ffffff1c;
}
:is(#appView, #portal, #loginView, #auth) {
  background: radial-gradient(ellipse at 84% 4%, #b7192b12, transparent 42rem),
    radial-gradient(ellipse at 15% 25%, #fff, transparent 38rem), var(--feast-canvas);
}
:is(#appView .topbar, #auth > .card, #loginView .login-card) {
  -webkit-backdrop-filter: blur(14px) saturate(115%);
  backdrop-filter: blur(14px) saturate(115%);
}
#appView .topbar {
  z-index: 12;
  background: #ffffffe0;
  border-bottom: 1px solid #ffffffeb;
  box-shadow: 0 2px 12px #17171a0b;
}
:is(#appView .sidebar, #portal .side) {
  background: linear-gradient(150deg, #29262cf5, #17171af5 52%, #201e24fa);
  box-shadow: inset -1px 0 #ffffff18;
}
:is(#appView .sidebar, #portal .side) :is(.nav button, :where(#mobileAdminMenu)),
#portal .side #logout {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #ffffff2b;
  border-radius: 14px;
  background: var(--nav-face);
  box-shadow: var(--nav-rim);
  color: #f4f3f5;
  cursor: pointer;
  text-align: left;
  line-height: 1.35;
  font-weight: 700;
}
#portal .side #logout {
  /* Override the original inline text-link presentation. */
  border: 1px solid #ffffff2b !important;
  padding: 10px 14px !important;
  background: var(--nav-face) !important;
  color: #f4f3f5 !important;
  margin-top: 10px;
}
:is(#appView .sidebar, #portal .side) .nav { gap: 6px; }
:is(#appView .sidebar, #portal .side) .nav button:is(.active, .on) {
  background: linear-gradient(140deg, #65333e, #362830);
  border-color: #ee8a984d;
  box-shadow: inset 3px 0 #ef6072, var(--nav-rim);
  color: white;
}
@media (hover: hover) {
  :is(#appView .sidebar, #portal .side) :is(.nav button, :where(#mobileAdminMenu)):hover,
  #portal .side #logout:hover { border-color: #ffffff6b; filter: brightness(1.14); }
}
:is(#appView .sidebar, #portal .side) button:focus-visible {
  outline: 2px solid white; outline-offset: 2px;
}

#appView .header-shortcuts { position: relative; }
#appView .header-shortcuts:not(:has(nav > .control-shortcut:not(.hide,[hidden]))) { display: none; }
.header-shortcuts summary {
  display: flex; align-items: center; gap: 10px;
  min-height: 42px; padding: 9px 16px;
  border: 1px solid #b7192b36; border-radius: 999px;
  background: linear-gradient(145deg, white, #fff2f3);
  box-shadow: inset 0 1px 0 white, 0 2px 5px #17171a0c;
  color: #8e1627; font-weight: 750; cursor: pointer; list-style: none;
}
.header-shortcuts summary::-webkit-details-marker { display: none; }
.header-shortcuts summary::after {
  content: ''; width: 7px; height: 7px; border: solid currentColor;
  border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg);
}
.header-shortcuts[open] summary::after { transform: translateY(2px) rotate(225deg); }
.header-shortcuts summary:focus-visible { outline: 3px solid var(--feast-red); outline-offset: 2px; }
.header-shortcuts nav {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 2;
  display: grid; gap: 4px; width: min(19rem, calc(100vw - 40px));
  max-height: min(58vh, 27rem); overflow-y: auto; overscroll-behavior: contain;
  padding: 8px; border: 1px solid #dddde2; border-radius: 18px;
  background: #fafafbf7; box-shadow: 0 12px 30px #17171a2b;
}
#appView .header-shortcuts .control-shortcut {
  width: 100%; min-height: 42px; text-align: left;
  padding: 10px 12px; border: 1px solid transparent; border-radius: 10px;
  color: var(--feast-charcoal); background: #ffffffa8; font: inherit; font-weight: 650;
  text-decoration: none; cursor: pointer; box-shadow: none;
}
#appView .header-shortcuts .control-shortcut:is(:hover, :focus-visible, .active) {
  background: #f9e9ec; color: #801021;
}
@media (max-width: 900px) {
  #appView .topbar-actions { position: relative; justify-content: flex-start; }
  #appView .header-shortcuts { position: static; }
  #appView .header-shortcuts nav { left: 0; right: auto; max-width: 100%; }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --feast-panel: #fafafb; }
  #appView .topbar, .header-shortcuts nav { background: #fff; }
  :is(#appView .topbar, #auth > .card, #loginView .login-card) {
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
}
/* Keep the mobile layout rule from revealing a signed-out workspace. */
#appView.app.hide { display: none !important; }
