/*
 * Styles for the PHP-rendered panel pages (login, dashboard, and the logout
 * confirmation these render into). Kept separate from src/styles.css so the
 * hero bundle does not carry rules a visitor who never logs in never needs.
 * Colour comes entirely from tokens.css — see docs/brand-palette.md.
 */

* , *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--surface);
  color: var(--paper);
  font-family: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

/* A quiet technical grid, echoing the hero's 3D scene without the weight of
   loading it — this page has no reason to ship Three.js. */
body {
  background-image:
    linear-gradient(var(--ink-700) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink-700) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center;
  background-attachment: fixed;
}

a { color: inherit; }

/* ------------------------------------------------------------- login page */

.auth {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(20px, 5vw, 64px);
}

.auth-card {
  width: min(400px, 100%);
  padding: clamp(28px, 4vw, 40px);
  border-radius: 14px;
  border: 1px solid var(--menu-edge);
  background: var(--plate-sheen), var(--plate-face);
  box-shadow:
    inset 0 1px 0 var(--plate-lip),
    inset 0 -1px 0 var(--plate-foot),
    0 28px 60px -24px var(--plate-cast);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(20px, 4vw, 32px);
}

/* The panel header's brand is a real link back to the homepage — session
   cookies are untouched by navigating there, so this never signs anyone out.
   A subtle fade is the only affordance it needs; it already looks exactly
   like the mark everywhere else on the site, which is the cue that it goes
   there. */
a.auth-brand {
  text-decoration: none;
  color: inherit;
  transition: opacity .15s ease;
}

a.auth-brand:hover { opacity: .82; }
a.auth-brand:focus-visible { outline: 2px solid var(--interactive); outline-offset: 4px; border-radius: 6px; }

.auth-mark { height: 36px; width: auto; flex: none; }
.auth-mark .p-orange { fill: var(--brand-orange); }
.auth-mark .p-blue { fill: var(--brand-blue); }
.auth-mark .p-purple { fill: var(--brand-violet); }
.auth-mark .p-red { fill: var(--brand-coral); }

.auth-text { display: flex; flex-direction: column; gap: 3px; }

.auth-tag {
  font-size: .5625rem;
  font-weight: 300;
  letter-spacing: .3em;
  text-indent: .3em;
  text-transform: uppercase;
  color: var(--paper-dim);
}

.auth-word {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  background: var(--steel-face);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .auth-word { color: var(--paper); background: none; }
}

.auth-title {
  margin: 0 0 6px;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -.01em;
}

.auth-lede {
  margin: 0 0 clamp(20px, 4vw, 28px);
  color: var(--paper-mute);
  font-size: .875rem;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: .6875rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--paper-mute);
}

.field-input {
  position: relative;
  display: flex;
  align-items: center;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--ink-500);
  border-radius: 8px;
  background: var(--ink-800);
  color: var(--paper);
  font: inherit;
  font-size: .9375rem;
  transition: border-color .16s ease, background-color .16s ease;
}

.field input::placeholder { color: var(--ink-300); }

.field input:focus {
  outline: none;
  border-color: var(--interactive);
  background: var(--ink-700);
}

.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--paper);
  transition: background-color 9999s ease-in-out 0s;
}

.field-toggle {
  position: absolute;
  right: 6px;
  padding: 6px 9px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--paper-mute);
  font: inherit;
  font-size: .6875rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}

.field-toggle:hover { color: var(--paper); }
.field-toggle:focus-visible { outline: 2px solid var(--interactive); outline-offset: 2px; }

.auth-error {
  margin: 0 0 16px;
  padding: 11px 13px;
  border: 1px solid rgba(248, 82, 70, .4);
  border-radius: 8px;
  background: rgba(248, 82, 70, .12);
  color: #ffb3ac;
  font-size: .8125rem;
}

.auth-submit {
  width: 100%;
  padding: 13px;
  margin-top: 6px;
  border: 1px solid var(--interactive);
  border-radius: 8px;
  background: var(--interactive);
  color: #ffffff;
  font: inherit;
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  transition: filter .16s ease;
}

.auth-submit:hover { filter: brightness(1.08); }
.auth-submit:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
.auth-submit[disabled] { cursor: default; opacity: .7; }

.auth-foot {
  margin-top: clamp(18px, 4vw, 26px);
  padding-top: clamp(16px, 3vw, 22px);
  border-top: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: .8125rem;
  color: var(--paper-mute);
}

.auth-foot a { text-decoration: none; }
.auth-foot a:hover { color: var(--paper); }
.auth-foot a:focus-visible { outline: 2px solid var(--interactive); outline-offset: 2px; border-radius: 2px; }

/* --------------------------------------------------------------- panel */

.panel-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 48px);
}

.panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 3vw, 24px);
  flex-wrap: wrap;
  margin-bottom: clamp(28px, 6vw, 56px);
}

.panel-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .8125rem;
  color: var(--paper-mute);
}

.panel-user strong { color: var(--paper); font-weight: 600; }

.panel-logout {
  padding: 9px 16px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: none;
  color: var(--paper-dim);
  font: inherit;
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease;
}

.panel-logout:hover { color: var(--paper); border-color: var(--brand-coral); }
.panel-logout:focus-visible { outline: 2px solid var(--interactive); outline-offset: 2px; }

.panel-heading {
  margin: 0 0 clamp(24px, 5vw, 40px);
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  font-weight: 700;
  letter-spacing: -.01em;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2vw, 20px);
}

@media (max-width: 860px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr; } }

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: clamp(170px, 22vw, 220px);
  padding: clamp(20px, 2.4vw, 26px);
  border-radius: 14px;
  text-align: left;
  text-decoration: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.tile--active {
  border: 1px solid var(--tile-ink, var(--interactive));
  background: var(--plate-sheen), var(--plate-face);
  box-shadow:
    inset 0 1px 0 var(--plate-lip),
    inset 0 -1px 0 var(--plate-foot),
    0 20px 40px -22px var(--plate-cast);
  color: var(--paper);
  transition: transform .18s ease, box-shadow .18s ease;
}

.tile--active:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 var(--plate-lip),
    inset 0 -1px 0 var(--plate-foot),
    0 26px 48px -22px var(--plate-cast);
}

.tile--active:focus-visible { outline: 2px solid var(--interactive); outline-offset: 3px; }

.tile-icon {
  width: 34px;
  height: 34px;
  color: var(--tile-ink, var(--interactive));
}

.tile-icon svg { width: 100%; height: 100%; display: block; }

.tile-name {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}

.tile-desc {
  margin: 0;
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--paper-mute);
}

.tile-badge {
  align-self: flex-start;
  margin-top: auto;
  padding: 5px 11px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  font-size: .625rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--paper-mute);
}

/* The four unnamed tiles: quiet and dashed, so they read as reserved space
   rather than as broken or forgotten features. */
.tile--empty {
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--ink-500);
  background: none;
  color: var(--ink-300);
  cursor: default;
}

.tile--empty .tile-badge {
  margin-top: 0;
  border-color: var(--ink-500);
  color: var(--ink-300);
}
