/* FemtoTV - Obsidian Frosted Glass */

:root {
  /* Colors — Varz palette: noir pur, gris, blanc */
  --bg: #080a0f;
  --bg-rgb: 8, 10, 15;
  --surface: #11151d;
  --surface-hover: #1a202b;
  --accent: #a78bfa;
  --accent-rgb: 167, 139, 250;
  --accent-hover: #c4b5fd;
  --accent-glow: rgba(167, 139, 250, 0.24);
  --grad: linear-gradient(135deg, #7c3aed, #a78bfa);

  /* Typography — enhanced: #aaa->#bbb, #888->#999 for better readability */
  --text: #e5e7eb;
  --text-bright: #fff;
  --muted: rgba(226, 232, 240, 0.68);
  --text-secondary: rgba(226, 232, 240, 0.68);
  --border: rgba(148, 163, 184, 0.16);
  --border-hover: rgba(196, 181, 253, 0.55);

  /* Unified spacing -- grid 4/8/12 px (base 16px = 0.25rem) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-6: 24px;
  --sp-8: 32px;

  /* z-index scale -- Nav: 40, Search: 45, Modal: 55, Player: 60, Toasts: 100
     ponytail: player 55 OTHERWISE detail (#detail 55) would be above video. */
  --z-nav: 40;
  --z-search: 45;
  --z-modal: 55;
  --z-player: 60;
  --z-toast: 100;

  /* Glass (subtle translucency + blur) */
  --glass: rgba(13, 17, 25, 0.82);
  --glass-border: rgba(226, 232, 240, 0.1);
  --blur: blur(20px);

  /* Radii & Shadows — arrondi moderne */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.85);
  --shadow-glow: 0 0 24px var(--accent-glow);

  /* props explicites (pas `all`): n'anime jamais layout/width/height par accident */
  --transition: color 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

/* Self-hosted variable fonts (latin only). ~48 KB Inter, ~32 KB Outfit.
   Google Fonts CDN removed: no headless blocking, no external DNS. */
@font-face {
  font-family: 'Inter';
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/Inter.woff2') format('woff2');
}
@font-face {
  font-family: 'Outfit';
  font-weight: 500 800;
  font-display: swap;
  src: url('/fonts/Outfit.woff2') format('woff2');
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  /* effet natif: un appui long ne surligne jamais l'UI (titres, onglets, boutons) */
  -webkit-user-select: none;
  user-select: none;
}

/* only input fields remain selectable */
input, textarea {
  -webkit-user-select: text;
  user-select: text;
}

/* Outfit font guaranteed on entire interactive chain (inherits body) */
button, input, select, textarea {
  font-family: inherit;
}

/* readable text content selectable (despite global user-select:none) */
.plot, .cast, .card .title {
  -webkit-user-select: text;
  user-select: text;
}

html {
  /* programmatic jumps (A-Z, anchors, scrollIntoView) must leave titles
     BELOW the sticky floating header, not behind it */
  scroll-padding-top: 6.5rem;
}

html, body {
  width: 100%;
  min-height: 100%; /* NOT height:100% -- it moves scroll out of window (scrollY stuck at 0) */
  background:
    radial-gradient(circle at 12% -10%, rgba(124, 58, 237, 0.14), transparent 34rem),
    radial-gradient(circle at 95% 0%, rgba(56, 189, 248, 0.07), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  /* clip not hidden: overflow-x hidden creates a scroll container that breaks
     position:sticky (header disparaissait au scroll) */
  overflow-x: clip;
  /* effet natif: le scroll ne fuit pas au fond, pas de pull-to-refresh accidentel */
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.45);
}

.accent {
  color: var(--accent);
  font-weight: 700;
}

a {
  color: var(--accent-hover);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--text-bright);
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

[hidden] {
  display: none !important;
}

/* Authentication Page */
.auth {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1.5rem, calc(env(safe-area-inset-top) + 0.5rem)) 1.5rem max(1.5rem, calc(env(safe-area-inset-bottom) + 0.5rem));
  background:
    radial-gradient(circle at 50% 0%, rgba(124, 58, 237, 0.2), transparent 34rem),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 3.25rem 2.5rem 2.5rem;
  border-radius: var(--radius-lg);
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.52), 0 0 0 1px rgba(167, 139, 250, 0.05);
  display: flex;
  flex-direction: column;
  animation: authFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-card h1.brand-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 2.5rem;
  letter-spacing: -0.8px;
}

.pass-wrap {
  position: relative;
  display: block;
  margin-bottom: 1.2rem;
}
.pass-wrap input {
  margin-bottom: 0;
  padding-right: 3rem;
  width: 100%;
  box-sizing: border-box;
}
.pass-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  padding: 0;
  margin: 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / 1.25rem no-repeat;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s, background-color 0.2s;
  display: grid;
  place-items: center;
}
.pass-toggle:hover { opacity: 1; background-color: rgba(255,255,255,0.08); }
.pass-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; opacity: 1; }
.pass-toggle.visible {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24M1 1l22 22'/%3E%3C/svg%3E");
  opacity: 0.9;
}
/* Hides native browser eye (Edge/Chrome) to keep only our own */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input[type="password"]::-webkit-credentials-auto-fill-button,
input[type="password"]::-webkit-textfield-decoration-container {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
  width: 0;
  height: 0;
}

.auth-card input {
  width: 100%;
  margin-bottom: 1.2rem;
  padding: 1.1rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-bright);
  font-size: 1rem;
  transition: var(--transition);
}

.auth-card input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.auth-card input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

.auth-card button[type=submit] {
  margin-top: 1rem;
  padding: 1.1rem;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: var(--shadow-glow);
  transition: var(--transition);
}

.auth-card button[type=submit]:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.15);
}

.auth-switch {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 2rem;
}

.auth-switch a {
  font-weight: 600;
  margin-left: 0.4rem;
  /* #audit-mobile: tap target — le lien etait 50x19px */
  display: inline-block;
  padding: 11px 8px;
}

.auth-error {
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  text-align: center;
}
