/*
 * SecureTransfer - Common Stylesheet
 *
 * Shared design tokens, CSS reset, header, and footer styles.
 * Included by: index.html, download.html, legal.html
 *
 * Author : Philip Boudin
 * Date   : May 2026
 */

/* === DESIGN TOKENS === */
:root {
  --bg:           #F4F2EE;
  --surface:      #FFFFFF;
  --ink:          #111110;
  --ink-2:        #5A5955;
  --ink-3:        #9A9894;
  --accent:       #1A6BFF;
  --accent-dk:    #0050D0;
  --success:      #0A7C4A;
  --danger:       #C0341D;
  --border:       rgba(0,0,0,0.10);
  --shadow:       0 2px 16px rgba(0,0,0,0.07);
  --radius:       16px;
  --radius-sm:    8px;
  --font-display: 'Outfit', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --transition:   0.2s cubic-bezier(0.4,0,0.2,1);
}
[data-theme="dark"] {
  --bg:      #0E0E0D;
  --surface: #1A1A18;
  --ink:     #F0EDE8;
  --ink-2:   #A8A5A0;
  --ink-3:   #5A5855;
  --border:  rgba(255,255,255,0.08);
  --shadow:  0 2px 24px rgba(0,0,0,0.4);
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}
img, svg { display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === HEADER === */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(244,242,238,0.85);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
[data-theme="dark"] header {
  background: rgba(14,14,13,0.85);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  color: var(--ink);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.logo-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}
#site-logo { max-height: 36px; width: auto; display: block; }
.badge-beta { background: #F59E0B; color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 100px; letter-spacing: 0.08em; vertical-align: middle; margin-left: 8px; text-decoration: none; cursor: default; pointer-events: none; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 8px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: border-color var(--transition), color var(--transition);
}
.header-select:hover, .header-select:focus {
  border-color: var(--accent);
  color: var(--ink);
}
/* Language switcher: a self-coded dropdown (not a native <select>, which can
   only hold text) so a vendored SVG flag shows before each language in the
   menu. Flag emoji are avoided because Windows renders them as letters (FR/EN);
   local SVGs render identically on every OS. */
.lang-switch { position: relative; display: inline-flex; }
.lang-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lang-current:hover, .lang-current:focus, .lang-current[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--ink);
}
.lang-caret { flex-shrink: 0; opacity: 0.7; }
.lang-flag {
  width: 16px;
  height: 12px;
  min-width: 16px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 2px;
  display: block;
}
.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 200;
  min-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lang-menu[hidden] { display: none; }
.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px 6px 8px;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}
.lang-option:hover, .lang-option:focus { background: var(--bg); color: var(--ink); outline: none; }
.lang-option[aria-current="true"] { color: var(--accent); font-weight: 600; }
@media (max-width: 480px) {
  .header-inner { height: 50px; }
  #site-logo    { max-height: 28px; }
  .header-select { font-size: 12px; padding: 3px 6px; }
}
@media (max-width: 360px) {
  #site-logo { max-height: 22px; }
}

/* === FOOTER === */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
}
footer a { color: var(--ink-3); }
footer a:hover { color: var(--accent); text-decoration: none; }

/* ── Ko-fi support button + modal ───────────────────────── */
/* Trigger button + intro prompt. The button opens a self-coded modal
   (see js/kofi-modal.js) - no external Ko-fi script is loaded; only an
   <iframe> to ko-fi.com, lazy-loaded on first open. */
.kofi-cta-wrap { text-align: center; margin-top: 24px; }
.kofi-prompt {
  font-size: 14px;
  color: var(--ink-2);
  margin: 0 0 10px;
}
.kofi-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background: #1A6BFF;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm, 8px);
  font-family: var(--font-display, sans-serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  cursor: pointer;
  transition: background var(--transition, 0.2s ease), transform var(--transition, 0.2s ease);
}
.kofi-btn:hover { background: #0050D0; transform: translateY(-1px); }
/* Explicit, robust sizing so the Ko-fi symbol never renders at its intrinsic
   SVG size (241x194) on browsers that ignore the implicit box (iOS Safari,
   Chrome). object-fit keeps the logo's aspect ratio inside the fixed box. */
.kofi-btn-icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  flex-shrink: 0;
  object-fit: contain;
  display: block;
}

/* Overlay + centred panel (built dynamically, shared across pages). */
.kofi-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 20px;
}
.kofi-overlay[hidden] { display: none; }
.kofi-panel {
  position: relative;
  background: #fff;
  border-radius: var(--radius, 16px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}
/* Scroll container: on screens shorter than the iframe (580px) the panel
   body scrolls internally so the whole widget stays reachable. */
.kofi-panel-body {
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.kofi-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.kofi-close:hover { background: #fff; }
#kofiframe { display: block; width: 100%; }
.kofi-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
body.kofi-modal-open { overflow: hidden; }

/* Mobile: panel uses (almost) the full width with small gutters and stays
   sized to the iframe - it scrolls internally if the screen is too short. */
@media (max-width: 480px) {
  .kofi-overlay { padding: 12px; }
  .kofi-panel { max-width: 100%; }
  .kofi-panel-body { max-height: 92vh; }
}
