/* 
 * Promocode Apps - Unified Legal Center Stylesheet
 * Perfectly replicates the UI of each app via CSS Variables
 */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Inter:wght@400;500;600;700;800&family=Unbounded:wght@800&family=Anton&family=Archivo:wght@400;500;700;900&family=Cinzel:wght@600;700&display=swap');

:root {
  /* Default Theme */
  --bg-page: #09090b;
  --text-page: #fafafa;
  --text-page-muted: #a1a1aa;
  
  --bg-card: #18181b;
  --text-card: #fafafa;
  --text-card-muted: #a1a1aa;
  --bg-surface: #27272a;
  
  --border-color: #3f3f46;
  --border-width: 1px;
  --border-radius-card: 16px;
  --border-radius-pill: 999px;
  
  --box-shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --box-shadow-btn: 0 2px 8px rgba(0,0,0,0.2);
  
  --accent-color: #f59e0b;
  --accent-text: #09090b;
  
  --font-heading: 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --heading-transform: none;
  --heading-weight: 700;
  --hero-title-size: 2.5rem;
  --hero-title-spacing: -0.5px;
}

/* ==========================================================================
   1. APP THEMES (DYNAMIC DATA-THEME ATTRIBUTES)
   ========================================================================== */

/* 🏠 HOME THEME (Listing des applications, neutre) */
[data-theme="home"] {
  --bg-page: #0b0c10;
  --text-page: #f7f7f8;
  --text-page-muted: #a1a1aa;

  --bg-card: #16171d;
  --text-card: #f7f7f8;
  --text-card-muted: #a1a1aa;
  --bg-surface: #22232b;

  --border-color: #2e2f38;
  --border-width: 1px;
  --border-radius-card: 20px;
  --border-radius-pill: 999px;

  --box-shadow-card: 0 14px 34px -18px rgba(0, 0, 0, 0.9);
  --box-shadow-btn: 0 2px 8px rgba(0, 0, 0, 0.25);

  --accent-color: #f0b429;
  --accent-text: #0b0c10;

  --font-heading: 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --heading-transform: none;
  --heading-weight: 800;
  --hero-title-size: 2.6rem;
  --hero-title-spacing: -1px;
}

/* 🕵️ ACCUZE THEME (Nuit Blanche / Enquête minimaliste sombre) */
[data-theme="accuze"] {
  --bg-page: #09090b;
  --text-page: #fafafa;
  --text-page-muted: #a1a1aa;
  
  --bg-card: #18181b;
  --text-card: #fafafa;
  --text-card-muted: #a1a1aa;
  --bg-surface: #27272a;
  
  --border-color: #3f3f46;
  --border-width: 1px;
  --border-radius-card: 16px;
  --border-radius-pill: 999px;
  
  --box-shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --box-shadow-btn: 0 2px 8px rgba(0,0,0,0.2);
  
  --accent-color: #d97706; /* amber-600 */
  --accent-text: #fafafa;
  
  --font-heading: 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --heading-transform: none;
  --heading-weight: 700;
  --hero-title-size: 2.5rem;
  --hero-title-spacing: -0.5px;
}

/* ⚡ BUZZIO THEME (Néobrutalisme Pop & Crème survolté) */
[data-theme="buzzio"] {
  --bg-page: #FFF6EC;
  --text-page: #20203A;
  --text-page-muted: #4A4A68;
  
  --bg-card: #FFFFFF;
  --text-card: #20203A;
  --text-card-muted: #4A4A68;
  --bg-surface: #FFF6EC;
  
  --border-color: #20203A;
  --border-width: 3px;
  --border-radius-card: 16px;
  --border-radius-pill: 999px;
  
  --box-shadow-card: 4px 4px 0px #20203A;
  --box-shadow-btn: 2px 2px 0px #20203A;
  
  --accent-color: #FF7AA8; /* Pop Pink */
  --accent-text: #20203A;
  
  --font-heading: 'Fredoka', sans-serif;
  --font-body: 'Fredoka', sans-serif;
  --heading-transform: none;
  --heading-weight: 700;
  --hero-title-size: 3rem;
  --hero-title-spacing: 0px;
}

/* 🐑 LOUTCHI THEME (Teal berger, Corail & cartes douces) */
[data-theme="loutchi"] {
  --bg-page: #F2F9F8;
  --text-page: #15202B;
  --text-page-muted: #5B6E7F;
  
  --bg-card: #FFFFFF;
  --text-card: #15202B;
  --text-card-muted: #5B6E7F;
  --bg-surface: #DFF0EC;
  
  --border-color: transparent;
  --border-width: 0px;
  --border-radius-card: 24px;
  --border-radius-pill: 999px;
  
  --box-shadow-card: 0px 6px 16px rgba(21, 32, 43, 0.14);
  --box-shadow-btn: 0px 2px 8px rgba(21, 32, 43, 0.08);
  
  --accent-color: #FB6F52; /* Coral */
  --accent-text: #FFFFFF;
  
  --font-heading: 'Unbounded', sans-serif;
  --font-body: 'Inter', sans-serif;
  --heading-transform: none;
  --heading-weight: 800;
  --hero-title-size: 2.8rem;
  --hero-title-spacing: -1px;
}

/* 🥊 PUNCHZ THEME (Cards Against Humanity Stark Black & White) */
[data-theme="punchz"] {
  --bg-page: #121212;
  --text-page: #FAFAF7;
  --text-page-muted: #9B9B9B;
  
  --bg-card: #FAFAF7;
  --text-card: #121212;
  --text-card-muted: #666666;
  --bg-surface: #E5E5E5;
  
  --border-color: #121212;
  --border-width: 0px; /* Outer card has no border */
  --border-width-inner: 2px; /* Buttons have border */
  --border-radius-card: 12px;
  --border-radius-pill: 8px;
  
  --box-shadow-card: none;
  --box-shadow-btn: none;
  
  --accent-color: #EFBF04; /* Gold */
  --accent-text: #121212;
  
  --font-heading: 'Anton', sans-serif;
  --font-body: 'Archivo', sans-serif;
  --heading-transform: uppercase;
  --heading-weight: 400; /* Anton is inherently bold */
  --hero-title-size: 3.5rem;
  --hero-title-spacing: 1px;
}

/* 🐙 KRAKEN THEME (Taverne médiévale sombre, bois & ambre) */
[data-theme="kraken"] {
  --bg-page: #081a23;
  --text-page: #f4e8cc;
  --text-page-muted: #9a8b6b;

  --bg-card: #241812;
  --text-card: #f4e8cc;
  --text-card-muted: #cdb98c;
  --bg-surface: #3a2719;

  --border-color: #4e3a25;
  --border-width: 1px;
  --border-radius-card: 16px;
  --border-radius-pill: 999px;

  --box-shadow-card: 0 12px 32px -12px rgba(0, 0, 0, 0.75);
  --box-shadow-btn: 0 2px 8px rgba(0, 0, 0, 0.35);

  --accent-color: #c8861f; /* Ambre / bière */
  --accent-text: #081a23;

  --font-heading: 'Cinzel', serif;
  --font-body: 'Inter', sans-serif;
  --heading-transform: none;
  --heading-weight: 700;
  --hero-title-size: 2.8rem;
  --hero-title-spacing: 0.5px;
}

/* 🏛️ HEMICYCLE THEME (Civic : gris-bleu froid, encre neutre, accent bleu) */
[data-theme="hemicycle"] {
  --bg-page: #0e1521;
  --text-page: #e9eef6;
  --text-page-muted: #98a3b5;

  --bg-card: #18212f;
  --text-card: #e9eef6;
  --text-card-muted: #98a3b5;
  --bg-surface: #1d2a47;

  --border-color: #283143;
  --border-width: 1px;
  --border-radius-card: 16px;
  --border-radius-pill: 999px;

  --box-shadow-card: 0 12px 32px -14px rgba(0, 0, 0, 0.7);
  --box-shadow-btn: 0 2px 8px rgba(0, 0, 0, 0.3);

  --accent-color: #7e9cf2; /* Bleu encre éclairci */
  --accent-text: #0e1521;

  --font-heading: 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --heading-transform: none;
  --heading-weight: 700;
  --hero-title-size: 2.5rem;
  --hero-title-spacing: -0.5px;
}

/* ==========================================================================
   2. GLOBAL LAYOUT & BASE STYLES
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

body {
  background-color: var(--bg-page);
  color: var(--text-page);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

.view {
  display: flex;
  flex-direction: column;
  flex: 1;
}

[hidden] {
  display: none !important;
}

/* Lang Switcher */
.lang-switcher {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  background-color: var(--bg-card);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-pill);
  padding: 4px;
  box-shadow: var(--box-shadow-btn);
  z-index: 100;
}

.lang-btn {
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--text-card-muted);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: var(--border-radius-pill);
  cursor: pointer;
}

.lang-btn.active {
  background-color: var(--accent-color);
  color: var(--accent-text);
}

/* ==========================================================================
   3. HERO SECTION & DOCUMENT TABS
   ========================================================================== */

.hero-section {
  padding: 60px 0 32px;
  text-align: center;
}

.hero-icon {
  margin-bottom: 16px;
  display: inline-block;
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hero-icon img {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: var(--box-shadow-card);
}

@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.hero-title {
  font-family: var(--font-heading);
  font-size: var(--hero-title-size);
  font-weight: var(--heading-weight);
  text-transform: var(--heading-transform);
  letter-spacing: var(--hero-title-spacing);
  margin-bottom: 8px;
  color: var(--text-page);
}

.hero-tagline {
  font-size: 1.15rem;
  color: var(--text-page-muted);
  max-width: 600px;
  margin: 0 auto 32px;
  font-weight: 500;
}

.back-link {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 100;
  display: inline-block;
  padding: 10px 16px;
  background-color: var(--bg-card);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-pill);
  box-shadow: var(--box-shadow-btn);
  color: var(--text-card-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

[data-theme="punchz"] .back-link {
  border-width: var(--border-width-inner);
}

.back-link::before {
  content: '\2190';
  margin-right: 8px;
}

.back-link:hover {
  color: var(--text-card);
  border-color: var(--accent-color);
}

/* ==========================================================================
   3b. APP LISTING GRID
   ========================================================================== */

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.app-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 28px;
  background-color: var(--bg-card);
  color: var(--text-card);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-card);
  box-shadow: var(--box-shadow-card);
  text-decoration: none;
  transform: translateY(0);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease;
}

.app-card:hover {
  border-color: var(--accent-color);
  transform: translateY(-3px);
}

.app-card-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
}

.app-card-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: var(--heading-weight);
  letter-spacing: var(--hero-title-spacing);
  margin-bottom: 6px;
}

.app-card-desc {
  color: var(--text-card-muted);
  font-size: 1rem;
  line-height: 1.5;
}

.app-card-cta {
  margin-top: auto;
  padding-top: 4px;
  color: var(--accent-color);
  font-weight: 700;
  font-size: 0.9rem;
}

.app-card-cta::after {
  content: '\2192';
  margin-left: 6px;
}

/* Nav Tabs */
.doc-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 12px 24px;
  background-color: var(--bg-card);
  color: var(--text-card-muted);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-pill);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: var(--box-shadow-btn);
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Punchz button overrides */
[data-theme="punchz"] .tab-btn, [data-theme="punchz"] .lang-switcher {
  border-width: var(--border-width-inner);
}

.tab-btn:hover {
  opacity: 0.9;
}

.tab-btn.active {
  background-color: var(--accent-color);
  color: var(--accent-text);
  border-color: var(--border-color); /* Retains border color if neo-brutalist */
}

/* ==========================================================================
   4. DOCUMENT CONTENT CARD
   ========================================================================== */

main.content-area {
  flex: 1;
  padding-bottom: 60px;
}

.legal-card {
  background-color: var(--bg-card);
  color: var(--text-card);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-card);
  padding: 48px;
  box-shadow: var(--box-shadow-card);
}

.legal-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 24px;
  margin-bottom: 32px;
  border-bottom: var(--border-width) solid var(--border-color);
  border-bottom-color: var(--bg-surface); /* softer line */
  color: var(--text-card-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.legal-intro {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-card);
  margin-bottom: 40px;
  font-weight: 500;
  background-color: var(--bg-surface);
  padding: 24px;
  border-radius: calc(var(--border-radius-card) - 6px);
}
[data-theme="accuze"] .legal-intro, [data-theme="punchz"] .legal-intro {
}
[data-theme="buzzio"] .legal-intro {
  border: var(--border-width) solid var(--border-color);
  box-shadow: var(--box-shadow-btn);
}

.legal-section {
  margin-bottom: 32px;
}

.legal-section h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: var(--heading-weight);
  text-transform: var(--heading-transform);
  color: var(--text-card);
  margin-bottom: 12px;
}

.legal-section p {
  color: var(--text-card-muted);
  margin-bottom: 12px;
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Data Deletion Form Block */
.deletion-box {
  background-color: var(--bg-surface);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-card);
  padding: 32px;
  margin-top: 24px;
}
[data-theme="buzzio"] .deletion-box {
  box-shadow: var(--box-shadow-btn);
}

.deletion-box h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: var(--heading-weight);
  text-transform: var(--heading-transform);
  color: var(--text-card);
  margin-bottom: 16px;
}

.form-group {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-card);
}

.form-input {
  padding: 14px 16px;
  border-radius: var(--border-radius-pill);
  border: var(--border-width) solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-card);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
}
[data-theme="punchz"] .form-input, [data-theme="punchz"] .submit-btn {
  border-width: var(--border-width-inner);
}

.form-input:focus {
  border-color: var(--accent-color);
}

select.form-input {
  appearance: none;
  cursor: pointer;
  padding-right: 44px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

.form-textarea {
  border-radius: var(--border-radius-card);
  resize: vertical;
  min-height: 140px;
  line-height: 1.6;
}

.honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
}
[data-theme="loutchi"] .form-input {
  border: 1px solid var(--text-card-muted);
}

.submit-btn {
  margin-top: 24px;
  padding: 14px 24px;
  background-color: var(--accent-color);
  color: var(--accent-text);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-pill);
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
  text-transform: var(--heading-transform);
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: var(--box-shadow-btn);
  width: 100%;
}
[data-theme="loutchi"] .submit-btn {
  font-family: var(--font-body);
  font-weight: 700;
}

.submit-btn:hover {
  opacity: 0.9;
}

.deletion-success {
  margin-top: 20px;
  padding: 16px;
  background-color: rgba(34, 197, 94, 0.15);
  border: 1px solid #22c55e;
  color: #22c55e;
  border-radius: var(--border-radius-pill);
  font-weight: 600;
  text-align: center;
}
[data-theme="punchz"] .deletion-success {
  border-width: var(--border-width-inner);
}

.form-error {
  margin-top: 20px;
  padding: 16px;
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #ef4444;
  border-radius: var(--border-radius-card);
  font-weight: 600;
  text-align: center;
}
[data-theme="punchz"] .form-error {
  border-width: var(--border-width-inner);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==========================================================================
   5. FOOTER
   ========================================================================== */

footer.site-footer {
  padding: 30px 0;
  text-align: center;
  color: var(--text-page-muted);
  font-size: 0.85rem;
  margin-top: auto;
}

/* Responsive adjust */
@media (max-width: 640px) {
  .hero-title {
    font-size: 2rem;
  }
  .legal-card {
    padding: 24px;
  }
}

/* Back link and lang switcher share the top row: keep them from overlapping */
@media (max-width: 480px) {
  .back-link {
    padding: 8px 12px;
    font-size: 0.7rem;
    max-width: calc(100% - 170px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .lang-btn {
    padding: 5px 9px;
    font-size: 0.7rem;
  }
}
