/* AuraPlay — visual identity
   -----------------------------------------------------------------
   Palette: warm twilight plum (not cold void-black), one friendly
   violet "aura" accent that does all the signature work, and a
   honeyed ember accent reserved for premium/paid signals. Corners
   are rounder and shadows are softer/warmer than a typical "dark
   mode" app, so the mystical theming reads as cozy rather than
   gothic. Display face is Fraunces (a warm, ink-trap serif) for
   anything that should feel ceremonial; Inter carries everything
   people actually have to read.
   ----------------------------------------------------------------- */

:root {
  --ap-void:        #1c1526;
  --ap-dusk:        #271e33;
  --ap-surface:     #322940;
  --ap-surface-2:   #3d3250;
  --ap-aura:        #a47bff;
  --ap-aura-soft:   #dccbff;
  --ap-ember:       #f5ac6e;
  --ap-moonlight:   #fbf6ff;
  --ap-smoke:       #b3a7c7;
  --ap-danger:      #ff96a8;

  --ap-font-display: 'Fraunces', Georgia, serif;
  --ap-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --ap-radius: 18px;
  --ap-radius-lg: 28px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ap-void);
  color: var(--ap-moonlight);
  font-family: var(--ap-font-body);
  line-height: 1.55;
  min-height: 100%;
}

a { color: inherit; text-decoration: none; }

/* ---------- Page shell + signature aura glow ---------- */

.ap-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
}

.ap-aura-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(164,123,255,0.26), rgba(164,123,255,0) 70%) center 28% / 60vw 60vw no-repeat,
    radial-gradient(closest-side, rgba(245,172,110,0.16), rgba(245,172,110,0) 70%) 85% 75% / 44vw 44vw no-repeat;
  animation: ap-breathe 9s ease-in-out infinite;
}

@keyframes ap-breathe {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .ap-aura-field { animation: none; }
}

.ap-wordmark {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 40px;
  font-family: var(--ap-font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.ap-wordmark .ap-ring {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--ap-aura);
  box-shadow: 0 0 14px 2px rgba(139,107,255,0.55);
}

/* ---------- Card ---------- */

.ap-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: linear-gradient(180deg, var(--ap-surface), var(--ap-dusk));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--ap-radius-lg);
  padding: 36px 32px;
  box-shadow: 0 30px 80px -30px rgba(28,16,32,0.7);
}

.ap-card h1 {
  font-family: var(--ap-font-display);
  font-size: clamp(22px, 4vw, 26px);
  font-weight: 600;
  margin: 0 0 6px;
}

.ap-card p.ap-sub {
  color: var(--ap-smoke);
  font-size: 14px;
  margin: 0 0 26px;
}

.ap-field {
  margin-bottom: 16px;
}

.ap-field label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ap-smoke);
  margin-bottom: 6px;
}

.ap-field input {
  width: 100%;
  background: var(--ap-surface-2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--ap-radius);
  padding: 12px 14px;
  color: var(--ap-moonlight);
  font-family: var(--ap-font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ap-field input:focus {
  border-color: var(--ap-aura);
  box-shadow: 0 0 0 3px rgba(139,107,255,0.25);
}

.ap-btn {
  width: 100%;
  border: none;
  border-radius: var(--ap-radius);
  padding: 13px 16px;
  font-family: var(--ap-font-body);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  background: var(--ap-aura);
  color: #1c1526;
  box-shadow: 0 10px 24px -12px rgba(164,123,255,0.55);
  transition: filter 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.ap-btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 14px 28px -12px rgba(164,123,255,0.65); }
.ap-btn:active { transform: scale(0.99) translateY(0); }

.ap-btn-ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.16);
  color: var(--ap-moonlight);
  box-shadow: none;
}

.ap-btn-ghost:hover { box-shadow: none; background: rgba(255,255,255,0.06); }

.ap-error {
  background: rgba(255,143,163,0.1);
  border: 1px solid rgba(255,143,163,0.35);
  color: var(--ap-danger);
  border-radius: var(--ap-radius);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 18px;
}

.ap-hint {
  font-size: 13px;
  color: var(--ap-smoke);
  margin-top: 4px;
}

.ap-footer-note {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  font-size: 13px;
  color: var(--ap-smoke);
  text-align: center;
}

.ap-footer-note a {
  color: var(--ap-aura-soft);
  border-bottom: 1px solid rgba(201,184,255,0.35);
}

.ap-footer-note a:hover { color: var(--ap-moonlight); }

/* ---------- Setup wizard ---------- */

.ap-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}

.ap-step-dot {
  width: 26px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.12);
}

.ap-step-dot.is-active {
  background: var(--ap-aura);
  box-shadow: 0 0 8px rgba(139,107,255,0.55);
}

.ap-icon-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.ap-icon-choice {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--ap-radius);
  background: var(--ap-surface-2);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.ap-icon-choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.ap-icon-choice-symbol { font-size: 22px; }

.ap-icon-choice:has(input:checked) {
  border-color: var(--ap-aura);
  box-shadow: 0 0 0 2px rgba(139,107,255,0.3);
  transform: translateY(-1px);
}

.ap-radio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  cursor: pointer;
  font-size: 15px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.ap-radio-row:last-child { border-bottom: none; }
.ap-radio-row input { accent-color: var(--ap-aura); width: 16px; height: 16px; }

.ap-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.ap-chip {
  cursor: pointer;
}

.ap-chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ap-chip span {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ap-surface-2);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 13px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ap-chip input:checked + span {
  border-color: var(--ap-aura);
  background: rgba(139,107,255,0.16);
  color: var(--ap-aura-soft);
}

/* ---------- AdminCP ---------- */

.ap-admin-shell {
  display: flex;
  min-height: 100vh;
}

.ap-admin-nav {
  width: 200px;
  flex-shrink: 0;
  background: var(--ap-dusk);
  border-right: 1px solid rgba(255,255,255,0.06);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ap-admin-nav a {
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ap-smoke);
}

.ap-admin-nav a.is-active {
  background: rgba(139,107,255,0.14);
  color: var(--ap-aura-soft);
}

.ap-admin-nav a:hover { color: var(--ap-moonlight); }

.ap-admin-main {
  flex: 1;
  padding: 32px clamp(20px, 3vw, 48px);
  max-width: 1100px;
}

.ap-admin-title {
  font-family: var(--ap-font-display);
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 20px;
}

.ap-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.ap-stat-card {
  background: var(--ap-surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--ap-radius);
  padding: 18px 20px;
}

.ap-stat-value {
  font-family: var(--ap-font-display);
  font-size: 30px;
  font-weight: 600;
  color: var(--ap-aura-soft);
}

.ap-stat-label {
  font-size: 13px;
  color: var(--ap-smoke);
  margin-top: 2px;
}

.ap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 12px;
}

.ap-table th {
  text-align: left;
  color: var(--ap-smoke);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.ap-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: middle;
}

.ap-admin-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 28px;
}

.ap-admin-form input[type="text"],
.ap-admin-form input[type="number"],
.ap-admin-form input[type="date"],
.ap-admin-form input:not([type]),
.ap-admin-form select,
.ap-admin-form textarea {
  background: var(--ap-surface-2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--ap-moonlight);
  font-family: var(--ap-font-body);
  font-size: 14px;
}

.ap-admin-form-wide {
  flex-direction: column;
  align-items: stretch;
  max-width: 560px;
}

.ap-admin-form-wide label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ap-smoke);
}

/* ---------- Homepage: hero, rails, cards ---------- */

.ap-shell-wide { max-width: 1400px; margin: 0 auto; }

.ap-profile-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ap-surface-2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 6px 14px 6px 8px;
  font-size: 13px;
}

.ap-hero {
  border-radius: var(--ap-radius-lg);
  padding: clamp(28px, 6vw, 64px);
  margin: 24px 0 8px;
  border: 1px solid rgba(255,255,255,0.06);
}

.ap-hero-inner { max-width: 560px; }

.ap-hero h1 {
  font-family: var(--ap-font-display);
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 600;
  margin: 0 0 12px;
}

.ap-hero-synopsis {
  color: var(--ap-moonlight);
  opacity: 0.85;
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 6px;
}

.ap-rail {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 4px 16px;
  scroll-snap-type: x proximity;
}

.ap-rail::-webkit-scrollbar { height: 6px; }
.ap-rail::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

.ap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

.ap-vcard {
  flex: 0 0 200px;
  scroll-snap-align: start;
  display: block;
  transition: transform 0.15s ease;
}

.ap-vcard:hover { transform: translateY(-4px); }

.ap-vcard-art {
  aspect-ratio: 2/3;
  border-radius: var(--ap-radius);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: flex-end;
  padding: 14px;
  margin-bottom: 8px;
  box-shadow: 0 14px 30px -18px rgba(28,16,32,0.6);
}

.ap-vcard-art span {
  font-family: var(--ap-font-display);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.25;
  color: var(--ap-moonlight);
  text-shadow: 0 2px 10px rgba(28,16,32,0.5);
}

.ap-vcard-meta {
  font-size: 12px;
  color: var(--ap-smoke);
}

.ap-vcard-progress {
  height: 3px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
  margin-bottom: 6px;
  overflow: hidden;
}

.ap-vcard-progress span {
  display: block;
  height: 100%;
  background: var(--ap-aura);
}

/* ---------- Video player ---------- */

.ap-player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--ap-radius-lg);
  overflow: hidden;
  margin-top: 16px;
}

.ap-player-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.ap-seek-zone {
  position: absolute;
  top: 0;
  bottom: 76px;
  width: 40%;
  cursor: pointer;
}

.ap-seek-left { left: 0; }
.ap-seek-right { right: 0; }

.ap-seek-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--ap-font-display);
  font-size: 28px;
  color: var(--ap-moonlight);
  background: rgba(28,16,32,0.5);
  padding: 10px 22px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
}

.ap-seek-flash.is-visible {
  animation: ap-flash 0.6s ease-out;
}

@keyframes ap-flash {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

.ap-overlay-panel {
  position: absolute;
  bottom: 96px;
  left: 24px;
  z-index: 3;
  background: rgba(20,17,31,0.92);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--ap-radius);
  padding: 16px 20px;
  max-width: 320px;
}

.ap-overlay-panel p { margin: 0 0 10px; font-size: 14px; }

.ap-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  background: linear-gradient(180deg, transparent, rgba(28,16,32,0.75) 60%);
  padding: 20px 16px 14px;
}

.ap-seek-bar {
  width: 100%;
  accent-color: var(--ap-aura);
  margin-bottom: 10px;
}

.ap-controls-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ap-ctrl-btn {
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--ap-moonlight);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 14px;
}

.ap-ctrl-btn:hover { background: rgba(255,255,255,0.16); }

.ap-ctrl-select {
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--ap-moonlight);
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 12px;
}

/* ---------- Post-login shell ---------- */

.ap-shell {
  min-height: 100vh;
  padding: 32px clamp(20px, 4vw, 64px);
}

.ap-shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

.ap-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.ap-badge-active {
  background: rgba(139,107,255,0.16);
  color: var(--ap-aura-soft);
  border: 1px solid rgba(139,107,255,0.35);
}

.ap-badge-none {
  background: rgba(224,168,106,0.12);
  color: var(--ap-ember);
  border: 1px solid rgba(224,168,106,0.3);
}

.ap-profile-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 18px;
}

.ap-profile {
  width: 130px;
  text-align: center;
}

.ap-profile-avatar {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--ap-radius);
  background: linear-gradient(160deg, var(--ap-surface-2), var(--ap-dusk));
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ap-font-display);
  font-size: 30px;
  color: var(--ap-aura-soft);
  margin-bottom: 8px;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.ap-profile:hover .ap-profile-avatar {
  border-color: var(--ap-aura);
  transform: translateY(-2px);
}

.ap-profile-name {
  font-size: 13px;
  color: var(--ap-smoke);
}

.ap-profile-add .ap-profile-avatar {
  color: var(--ap-smoke);
  font-size: 22px;
}

.ap-section-title {
  font-family: var(--ap-font-display);
  font-size: 20px;
  font-weight: 600;
  margin: 36px 0 4px;
}

@media (max-width: 480px) {
  .ap-card { padding: 28px 22px; }
}
