/* ─────────────────────────────────────────────────────────────
   New Hype City — Artist Portal
   Shared styles. Tokens mirror the landing page (index.html) so the
   portal reads as the same product.
   ───────────────────────────────────────────────────────────── */

:root {
  --black: #08080c;
  --dark: #111118;
  --surface: #18181f;
  --surface-light: #222230;
  --neon-pink: #ff2d78;
  --neon-blue: #00d4ff;
  --neon-purple: #b44dff;
  --neon-yellow: #ffe156;
  --green: #3ddc84;
  --text: #e8e6f0;
  --text-dim: #8886a0;
  --font-display: 'Righteous', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --font-body: 'Outfit', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { background: var(--black); }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--black);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* Grain overlay — same as the landing page. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

a { color: var(--neon-blue); }

/* ── NAV ── */
.portal-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.6rem;
  background: linear-gradient(to bottom, var(--black), rgba(8, 8, 12, 0.85));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--surface-light);
}

.portal-nav .logo {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--neon-pink);
  text-shadow: 0 0 20px rgba(255, 45, 120, 0.4);
  text-decoration: none;
}

.portal-nav .logo span { color: var(--text-dim); font-size: 0.7rem; }

.portal-nav .nav-right {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.portal-nav .nav-right a { color: var(--text-dim); text-decoration: none; transition: color 0.2s; }
.portal-nav .nav-right a:hover { color: var(--neon-blue); }
.portal-nav .nav-right a.active { color: var(--text); }

/* ── LAYOUT ── */
.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.6rem 4rem;
}
.wrap.narrow { max-width: 460px; }

.page-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--neon-blue);
  margin-bottom: 0.5rem;
}

h1.page-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1.1;
  margin-bottom: 0.6rem;
}

.page-sub { color: var(--text-dim); font-size: 0.95rem; margin-bottom: 2rem; line-height: 1.5; }

/* ── CARD ── */
.card {
  background: var(--surface);
  border: 1px solid var(--surface-light);
  padding: 1.6rem;
  margin-bottom: 1.2rem;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

.card-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 400; margin-bottom: 0.6rem; }
.card-text { color: var(--text-dim); font-size: 0.9rem; line-height: 1.5; margin-bottom: 1rem; }

/* ── TWO-FACTOR (security.html, sign-in code step) ── */
/* Blocks that only one of is on screen at a time. */
.hidden-block { display: none; }
.hidden-block.shown { display: block; }
/* White behind the QR code: scanners need the contrast, dark theme or not. */
.qr { display: block; width: 200px; height: 200px; margin: 0.4rem auto 1.2rem; background: #fff; padding: 6px; }
.codes {
  background: var(--dark);
  border: 1px solid var(--surface-light);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.8;
  padding: 0.8rem 1rem;
  margin-bottom: 1.2rem;
  white-space: pre-wrap;
  word-break: break-all;
  user-select: all;
}

/* ── FORMS ── */
.field { margin-bottom: 1.2rem; }

label.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.45rem;
}
label.field-label .req { color: var(--neon-pink); }

input[type="text"],
input[type="email"],
input[type="password"],
select {
  width: 100%;
  background: var(--dark);
  border: 1px solid var(--surface-light);
  color: var(--text);
  font-family: var(--font-body);
  /* Must stay >= 16px: iOS Safari zooms into any smaller field on focus
     and does not zoom back out. */
  font-size: 1rem;
  padding: 0.8rem 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.12);
}

input::placeholder { color: #55536a; }
input:disabled, select:disabled { opacity: 0.5; cursor: not-allowed; }

/* Dropdowns — same box as the text inputs, with our own caret so the
   control looks identical across browsers. */
select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%238886a0' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 11px 7px;
}
select:hover { border-color: var(--surface-light); }
select option { background: var(--dark); color: var(--text); }
/* The unselected placeholder reads like an input placeholder. */
select.is-empty { color: #55536a; }

.hint { font-size: 0.78rem; color: var(--text-dim); margin-top: 0.35rem; }

/* File drop inputs */
.file-input {
  position: relative;
  border: 1px dashed var(--surface-light);
  background: var(--dark);
  padding: 1.1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.file-input:hover { border-color: var(--neon-blue); }
.file-input.has-file { border-style: solid; border-color: var(--green); }
.file-input input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-input .fi-label { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim); }
.file-input .fi-name { color: var(--text); font-size: 0.88rem; margin-top: 0.3rem; word-break: break-all; }
.file-input.error { border-color: var(--neon-pink); }

.artwork-preview {
  width: 120px; height: 120px;
  object-fit: cover;
  margin: 0 auto 0.6rem;
  display: none;
  border: 1px solid var(--surface-light);
}

/* Checkbox */
.consent {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-dim);
}
.consent input { margin-top: 0.2rem; width: 16px; height: 16px; accent-color: var(--neon-pink); flex-shrink: 0; }
/* The Terms require three separate boxes, so they stack — without this they
   run together and read as one paragraph with stray checkboxes in it. */
.consent + .consent { margin-top: 0.75rem; }
.consent ul { margin: 0.5rem 0 0 1.1rem; }
.consent li { margin-bottom: 0.25rem; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  padding: 0.85rem 1.8rem;
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 0, 0, 1);
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 11px 100%, 0 calc(100% - 11px));
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--neon-pink); color: var(--black); }
.btn-primary:not(:disabled):hover {
  background: #ff4d90;
  box-shadow: 0 0 30px rgba(255, 45, 120, 0.5);
  transform: translateY(-2px);
}

.btn-ghost { background: transparent; color: var(--neon-blue); border: 1px solid var(--neon-blue); }
.btn-ghost:not(:disabled):hover { background: rgba(0, 212, 255, 0.1); }

.btn-danger { background: transparent; color: var(--neon-pink); border: 1px solid rgba(255, 45, 120, 0.5); }
.btn-danger:not(:disabled):hover { background: rgba(255, 45, 120, 0.12); border-color: var(--neon-pink); }

.btn-block { width: 100%; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.7rem; }

/* ── TABS ── */
.tabs { display: flex; gap: 0; margin-bottom: 1.6rem; border-bottom: 1px solid var(--surface-light); }
.tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.9rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.tab.active { color: var(--text); border-bottom-color: var(--neon-pink); }

/* ── CAP METER ── */
.cap-meter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 1.2rem;
}
.cap-bar { flex: 1; height: 6px; background: var(--surface-light); margin: 0 0.9rem; position: relative; }
.cap-bar span { position: absolute; inset: 0 auto 0 0; background: var(--neon-blue); transition: width 0.3s; }
.cap-bar.full span { background: var(--neon-pink); }

/* ── LIST HEADER ── */
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

/* ── TRACK LIST ── */
.track {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--surface-light);
  padding: 0.9rem;
  margin-bottom: 0.8rem;
}
.track .art { width: 56px; height: 56px; object-fit: cover; background: var(--dark); flex-shrink: 0; }
.track .meta { flex: 1; min-width: 160px; }
.track .meta .t-title { font-weight: 600; }
.track .meta .t-artist { color: var(--text-dim); font-size: 0.85rem; }
.track .actions { display: flex; gap: 0.5rem; flex-shrink: 0; margin-left: auto; }

.badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.22rem 0.5rem;
  display: inline-block;
}
.badge-pending  { background: rgba(255, 225, 86, 0.14); color: var(--neon-yellow); }
.badge-approved { background: rgba(61, 220, 132, 0.14); color: var(--green); }
.badge-rejected { background: rgba(136, 134, 160, 0.16); color: var(--text-dim); }
.badge-dead     { background: rgba(255, 45, 120, 0.14); color: var(--neon-pink); }

/* ── ALERTS ── */
.alert {
  font-size: 0.88rem;
  padding: 0.8rem 1rem;
  margin-bottom: 1.2rem;
  border-left: 3px solid;
}
.alert-error   { background: rgba(255, 45, 120, 0.08); border-color: var(--neon-pink); color: #ffb3cd; }
.alert-success { background: rgba(61, 220, 132, 0.08); border-color: var(--green); color: #a8f0c8; }
.alert.hidden { display: none; }

.field-error { color: var(--neon-pink); font-size: 0.78rem; margin-top: 0.35rem; min-height: 1em; }

/* ── MODAL ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(8, 8, 12, 0.8);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 200;
  padding: 1.2rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--surface-light);
  padding: 1.6rem;
  max-width: 440px; width: 100%;
}
.modal h3 { font-family: var(--font-display); margin-bottom: 1rem; }
.modal-actions { display: flex; gap: 0.7rem; justify-content: flex-end; margin-top: 1.4rem; }

.empty { text-align: center; color: var(--text-dim); padding: 3rem 1rem; font-size: 0.95rem; }
.center { text-align: center; }
.mt { margin-top: 1.2rem; }
.spinner-text { color: var(--text-dim); font-family: var(--font-mono); font-size: 0.8rem; }

/* ── MOBILE ──
   The nav needs ~453px to sit on one line, so every phone in portrait wraps
   it without these. The widths below keep the three-link nav on one line
   down to 320px (iPhone SE); the four-link signed-in nav wraps below ~380px. */
@media (max-width: 560px) {
  .portal-nav { padding: 0.9rem 1rem; gap: 0.7rem; }

  /* The "/ artists" suffix is the first thing to go — the logo alone still
     says where you are, and dropping it buys back the width the links need. */
  .portal-nav .logo { font-size: 0.9rem; white-space: nowrap; }
  .portal-nav .logo span { display: none; }

  /* With the Security link, the signed-in nav no longer fits on one line
     below ~380px. Let the links drop under the logo instead of pushing the
     page sideways; margin-left keeps them right-aligned either way. */
  .portal-nav { flex-wrap: wrap; row-gap: 0.4rem; }
  .portal-nav .nav-right { margin-left: auto; gap: 0.8rem; font-size: 0.66rem; letter-spacing: 0.05em; }
  /* Vertical padding widens the tap area without changing the nav's look. */
  .portal-nav .nav-right a { white-space: nowrap; padding: 0.5rem 0; }

  .wrap { padding: 1.8rem 1.1rem 3rem; }
  .card { padding: 1.15rem; }
  h1.page-title { font-size: 1.6rem; }

  /* 44px is the minimum comfortable tap target. .btn-sm drives every track
     action and both modal buttons, so it grows on touch. */
  .btn-sm { padding: 0.7rem 1.05rem; min-height: 44px; }
}

@media (max-width: 480px) {
  .list-header { flex-direction: column; align-items: stretch; }
  .list-header .btn { align-self: flex-start; }

  .track .actions { width: 100%; margin-left: 0; justify-content: flex-end; }

  /* The bar was being crushed to ~100px between the two labels. Give it its
     own row underneath them instead. */
  .cap-meter { flex-wrap: wrap; }
  .cap-bar { min-width: 100%; order: 3; margin: 0.55rem 0 0; }
}

@media (max-width: 400px) {
  .portal-nav .nav-right { gap: 0.65rem; font-size: 0.62rem; letter-spacing: 0.02em; }
  .portal-nav .logo { font-size: 0.82rem; }
}

/* Portal footer. Carries the DMCA link on every artist-facing page, because
   the notice has to be reachable from the pages where audio is actually
   uploaded — not only from the marketing site. */
.portal-footer {
  max-width: 780px;
  margin: 3rem auto 2.5rem;
  padding: 1.2rem 1.5rem 0;
  border-top: 1px solid var(--surface-light);
  display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem;
  align-items: baseline;
  font-family: var(--font-mono); font-size: 0.68rem;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.portal-footer a { color: var(--text-dim); text-decoration: none; transition: color 0.2s; }
.portal-footer a:hover { color: var(--neon-blue); }
.portal-footer .copy { color: var(--text-dim); opacity: 0.45; margin-left: auto; text-transform: none; letter-spacing: 0; }
