/* ═══════════════════════════════════════════════════════════════════════════
   Eule & Spiegel — Design System CSS
   Shared between public download page and admin panel.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────────────────────────────── */

:root {
  --brg-950: #041a13;
  --brg-900: #07261c;
  --brg-800: #0b3d2e;
  --brg-700: #15553f;
  --ink: #102019;
  --gold: #b08d57;
  --gold-strong: #8f6d3b;
  --gold-hover: #c39d62;
  --accent-glow: rgba(176, 141, 87, 0.4);
  --cream-100: #f9f5ec;
  --cream-200: #f2ebdd;
  --text-secondary: rgba(249, 245, 236, 0.72);
  --stone-500: #7b7f74;
  --glass-bg: linear-gradient(155deg, rgba(249,245,236,0.10), rgba(249,245,236,0.04) 40%, rgba(4,26,19,0.55) 100%);
  --glass-border: rgba(249, 245, 236, 0.18);
  --glass-shadow: 0 32px 72px rgba(0,0,0,0.38), inset 0 1px 0 rgba(255,255,255,0.18);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

/* ── Light mode (system) ── */
@media (prefers-color-scheme: light) and (max-width: 0) {
  :root:not([data-theme="dark"]) {
    --brg-950: #f9f5ec; --brg-900: #f2ebdd; --brg-800: #e8dfcf; --brg-700: #d5cbb8;
    --gold: #8f6d3b; --gold-strong: #7a5c2e; --gold-hover: #a67d45;
    --accent-glow: rgba(143,109,59,0.25);
    --cream-100: #102019; --cream-200: #1a3328;
    --text-secondary: rgba(16,32,25,0.68); --stone-500: #6b705c;
    --glass-bg: linear-gradient(155deg, rgba(255,255,255,0.92), rgba(249,245,236,0.85) 40%, rgba(242,235,221,0.88) 100%);
    --glass-border: rgba(16,32,25,0.12);
    --glass-shadow: 0 24px 56px rgba(16,32,25,0.1), inset 0 1px 0 rgba(255,255,255,0.9);
  }
}
/* ── Light mode (manual toggle) ── */
html[data-theme="light"] {
  --brg-950: #f9f5ec; --brg-900: #f2ebdd; --brg-800: #e8dfcf; --brg-700: #d5cbb8;
  --gold: #8f6d3b; --gold-strong: #7a5c2e; --gold-hover: #a67d45;
  --accent-glow: rgba(143,109,59,0.25);
  --cream-100: #102019; --cream-200: #1a3328;
  --text-secondary: rgba(16,32,25,0.68); --stone-500: #6b705c;
  --glass-bg: linear-gradient(155deg, rgba(255,255,255,0.92), rgba(249,245,236,0.85) 40%, rgba(242,235,221,0.88) 100%);
  --glass-border: rgba(16,32,25,0.12);
  --glass-shadow: 0 24px 56px rgba(16,32,25,0.1), inset 0 1px 0 rgba(255,255,255,0.9);
}

/* ── Reset ─────────────────────────────────────────────────────────────── */

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

html { height: 100%; }
html, body { overscroll-behavior: none; }

/* ── Body & Background ─────────────────────────────────────────────────── */

body {
  font-family: 'Manrope', sans-serif;
  color: var(--cream-100);
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background-color: #071f18;
  background-image:
    radial-gradient(circle at 14% 10%, rgba(73,157,106,0.15), transparent 34%),
    radial-gradient(circle at 88% 88%, rgba(14,40,33,0.55), transparent 38%),
    linear-gradient(164deg, #071f18, #0b3d2e 46%, #08291f);
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
  transition: background-image 0.4s ease, color 0.4s ease;
}
@media (prefers-color-scheme: light) and (max-width: 0) {
  body:not([data-forced-theme]) {
    background-image:
      radial-gradient(circle at 14% 10%, rgba(143,109,59,0.06), transparent 34%),
      radial-gradient(circle at 88% 88%, rgba(242,235,221,0.35), transparent 38%),
      linear-gradient(164deg, #f9f5ec, #f2ebdd 46%, #e8dfcf);
  }
}
html[data-theme="light"] body {
  background-image:
    radial-gradient(circle at 14% 10%, rgba(143,109,59,0.06), transparent 34%),
    radial-gradient(circle at 88% 88%, rgba(242,235,221,0.35), transparent 38%),
    linear-gradient(164deg, #f9f5ec, #f2ebdd 46%, #e8dfcf);
}

/* ── Blobs (animated floating background circles) ──────────────────────── */

.blob {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(80px);
}
.blob-1 {
  width: 600px; height: 600px;
  top: -150px; left: -150px;
  background: radial-gradient(circle, rgba(73,157,106,0.25) 0%, transparent 70%);
  animation: float 22s ease-in-out infinite alternate;
  opacity: 0.35;
}
.blob-2 {
  width: 450px; height: 450px;
  bottom: -100px; right: -100px;
  background: radial-gradient(circle, rgba(176,141,87,0.18) 0%, transparent 70%);
  animation: float 22s ease-in-out infinite alternate-reverse;
  opacity: 0.18;
}

@keyframes float {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(50px, 35px) scale(1.1); }
}

/* ── Header (fixed, glassmorphism) ─────────────────────────────────────── */

:root {
  /* Single source of truth for the fixed header so .page / main can reserve
     equivalent space — fixes content-under-header overlap (incl. iOS notch). */
  --es-header-h: 64px;
  --es-header-safe: calc(var(--es-header-h) + env(safe-area-inset-top, 0px));
}

header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Reserve the iOS notch on top of the visual header padding */
  padding: calc(14px + env(safe-area-inset-top, 0px)) 40px 14px;
  min-height: var(--es-header-h);
  box-sizing: border-box;
  backdrop-filter: blur(20px) saturate(150%);
  background: rgba(4,26,19,0.65);
  border-bottom: 1px solid rgba(249,245,236,0.07);
  transition: background 0.4s ease, border-color 0.4s ease;
}

/* Generic content-clears-header rule. Pages that have their own padding
   (.audio-page, .shared-page) opt out by setting their own padding-top. */
body > main.page:not(.audio-page):not(.shared-page) {
  padding-top: calc(var(--es-header-safe) + 8px);
}
@media (prefers-color-scheme: light) and (max-width: 0) { header { background: rgba(249,245,236,0.75); border-bottom-color: rgba(16,32,25,0.06); } }
html[data-theme="light"] header { background: rgba(249,245,236,0.75); border-bottom-color: rgba(16,32,25,0.06); }
html[data-theme="light"] .header-logo-img { filter: invert(1) brightness(0.2); }

/* Force dark header when user toggles dark */
html[data-theme="dark"] header { background: rgba(4,26,19,0.65); border-bottom-color: rgba(249,245,236,0.07); }
html[data-theme="dark"] .header-logo-img { filter: none; }

/* Light: blobs, overlay, card, dividers, inputs */
@media (prefers-color-scheme: light) and (max-width: 0) { .blob-1, .blob-2 { opacity: 0.08; } }
html[data-theme="light"] .blob-1, html[data-theme="light"] .blob-2 { opacity: 0.08; }

@media (prefers-color-scheme: light) and (max-width: 0) {
  .video-overlay { background: linear-gradient(180deg, rgba(249,245,236,0.65) 0%, rgba(249,245,236,0.82) 50%, rgba(249,245,236,0.95) 100%); }
  .header-logo-img { filter: invert(1) brightness(0.2); }
}
html[data-theme="light"] .video-overlay { background: linear-gradient(180deg, rgba(249,245,236,0.65) 0%, rgba(249,245,236,0.82) 50%, rgba(249,245,236,0.95) 100%); }

@media (prefers-color-scheme: light) and (max-width: 0) {
  .delivery-page .card {
    background: linear-gradient(155deg, rgba(255,255,255,0.92) 0%, rgba(249,245,236,0.88) 40%, rgba(242,235,221,0.9) 100%);
    border-color: rgba(16,32,25,0.1);
    box-shadow: 0 24px 56px rgba(16,32,25,0.08), inset 0 1px 0 rgba(255,255,255,0.9);
  }
  .message-text { background: rgba(16,32,25,0.04); border-color: rgba(16,32,25,0.08); }
  .section-divider { background: linear-gradient(90deg, transparent, rgba(16,32,25,0.08), transparent); }
  .file-item:hover { background: rgba(16,32,25,0.04); }
  .expiry-track { background: rgba(16,32,25,0.08); }
  .pw-input { background: rgba(16,32,25,0.05); border-color: rgba(16,32,25,0.12); }
}
html[data-theme="light"] .delivery-page .card {
  background: linear-gradient(155deg, rgba(255,255,255,0.92) 0%, rgba(249,245,236,0.88) 40%, rgba(242,235,221,0.9) 100%);
  border-color: rgba(16,32,25,0.1);
  box-shadow: 0 24px 56px rgba(16,32,25,0.08), inset 0 1px 0 rgba(255,255,255,0.9);
}
html[data-theme="light"] .message-text { background: rgba(16,32,25,0.04); border-color: rgba(16,32,25,0.08); }
html[data-theme="light"] .section-divider { background: linear-gradient(90deg, transparent, rgba(16,32,25,0.08), transparent); }
html[data-theme="light"] .file-item:hover { background: rgba(16,32,25,0.04); }
html[data-theme="light"] .expiry-track { background: rgba(16,32,25,0.08); }
html[data-theme="light"] .pw-input { background: rgba(16,32,25,0.05); border-color: rgba(16,32,25,0.12); }
html[data-theme="light"] .theme-toggle { background: rgba(16,32,25,0.05); border-color: rgba(16,32,25,0.1); }

/* ── Lightbox ─────────────────────────────────────────────────────────── */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,0.92); backdrop-filter: blur(16px);
  align-items: center; justify-content: center; flex-direction: column;
  padding: 60px 40px 40px;
}
.lightbox.active { display: flex; }
.lightbox.active ~ footer,
.lightbox.active ~ .footer,
body.lightbox-open footer { display: none !important; }
body.lightbox-open header { z-index: 0 !important; pointer-events: none; }
.lightbox-close {
  position: fixed; top: 20px; right: 20px;
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25);
  color: #fff; width: 48px; height: 48px; border-radius: 50%;
  font-size: 20px; cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: all 200ms; z-index: 100000;
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); }
.lightbox-content {
  max-width: 90vw; max-height: 75vh; display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.lightbox-content img {
  max-width: 100%; max-height: 75vh; object-fit: contain;
  border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-content video {
  max-width: 100%; max-height: 75vh; border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-content audio { width: 400px; max-width: 90vw; }
/* Preview link — simple text */
.file-preview-link {
  background: none; border: none; padding: 0; margin: 0;
  font-family: inherit; font-size: 12px; color: var(--stone-500);
  cursor: pointer; text-decoration: none; transition: color 200ms;
}
.file-preview-link:hover {
  color: var(--gold); text-decoration: underline;
}

/* ── Audio Waveform Player ─────────────────────────────────────────── */
.lb-audio-player {
  width: 440px; max-width: 90vw; padding: 28px 32px;
  background: rgba(10,30,22,0.6); backdrop-filter: blur(16px);
  border: 1px solid rgba(249,245,236,0.1); border-radius: 20px;
}
.waveform-wrap {
  position: relative; margin-bottom: 16px; border-radius: 8px; overflow: hidden;
}
.waveform-canvas { width: 100%; height: 80px; display: block; }
.waveform-progress {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: rgba(176,141,87,0.06); pointer-events: none;
  transition: width 100ms linear;
}
.waveform-controls { display: flex; align-items: center; gap: 14px; }
.waveform-play {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: var(--gold); color: var(--ink); font-size: 16px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 200ms; flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(176,141,87,0.3);
}
.waveform-play:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(176,141,87,0.4); }
.waveform-play:active { transform: scale(0.95); }
.waveform-time {
  font-size: 13px; color: var(--stone-500); font-variant-numeric: tabular-nums;
}
.lb-pdf { width: 80vw; height: 80vh; max-width: 900px; border: none; border-radius: 12px; background: #fff; }

/* ── Custom Select (replaces native <select>) ─────────────────────── */
.custom-select {
  position: relative; display: inline-block; min-width: 160px;
}
.custom-select-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px; border-radius: 10px;
  border: 1px solid rgba(249,245,236,0.12); background: rgba(249,245,236,0.04);
  color: var(--cream-200); font-size: 13px; cursor: pointer; transition: all 200ms;
}
.custom-select-trigger:hover { border-color: rgba(249,245,236,0.2); background: rgba(249,245,236,0.08); }
.custom-select-trigger i { font-size: 10px; color: var(--stone-500); transition: transform 200ms; }
.custom-select.open .custom-select-trigger i { transform: rotate(180deg); }
.custom-select-dropdown {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 999;
  background: rgba(10,30,22,0.95); backdrop-filter: blur(16px);
  border: 1px solid rgba(249,245,236,0.12); border-radius: 12px;
  padding: 6px 0; max-height: 240px; overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  display: none; animation: ctxIn 0.15s ease;
}
.custom-select.open .custom-select-dropdown { display: block; }
.custom-select-option {
  padding: 8px 14px; font-size: 13px; color: var(--cream-200);
  cursor: pointer; transition: background 120ms;
}
.custom-select-option:hover { background: rgba(249,245,236,0.08); }
.custom-select-option.selected { color: var(--gold); }
.custom-select-option.indent { padding-left: 28px; font-size: 12px; }
.custom-select-option.indent::before { content: '└'; margin-right: 6px; opacity: 0.4; }
@media (prefers-color-scheme: light) and (max-width: 0) {
  .custom-select-trigger { background: rgba(16,32,25,0.03); border-color: rgba(16,32,25,0.1); color: var(--ink); }
  .custom-select-dropdown { background: rgba(255,255,255,0.95); border-color: rgba(16,32,25,0.1); }
  .custom-select-option { color: var(--ink); }
  .custom-select-option:hover { background: rgba(16,32,25,0.05); }
  .lb-audio-player { background: rgba(255,255,255,0.8); border-color: rgba(16,32,25,0.1); }
}
html[data-theme="light"] .custom-select-trigger { background: rgba(16,32,25,0.03); border-color: rgba(16,32,25,0.1); color: var(--ink); }
html[data-theme="light"] .custom-select-dropdown { background: rgba(255,255,255,0.95); border-color: rgba(16,32,25,0.1); }

.lightbox-filename {
  color: rgba(255,255,255,0.5); font-size: 13px; margin-top: 16px;
  text-align: center; max-width: 90vw; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
  flex-shrink: 0;
}

.header-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
}
.header-logo-img {
  height: 28px;
  width: auto;
  opacity: 0.9;
  transition: opacity 200ms var(--ease);
}
.header-logo-img:hover { opacity: 1; }

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-secure {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone-500);
  display: flex;
  align-items: center;
  gap: 6px;
}
.header-secure i {
  color: var(--gold);
  opacity: 0.7;
  font-size: 10px;
}

/* ── Page Layout ───────────────────────────────────────────────────────── */

.page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 60px;
  z-index: 1;
  position: relative;
  min-height: calc(100vh - 80px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Card (glassmorphism) ──────────────────────────────────────────────── */

.card {
  width: 100%;
  max-width: 480px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(145%);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  animation: slideUp 0.65s var(--ease) both;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}

/* ── Sender Section ────────────────────────────────────────────────────── */

.sender-section {
  padding: 28px 28px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.sender-logo {
  width: 50%;
  max-width: 280px;
  min-width: 120px;
  height: auto;
  object-fit: contain;
}
.sender-logo--light { display: none; }
@media (prefers-color-scheme: light) and (max-width: 0) {
  .sender-logo--dark { display: none; }
  .sender-logo--light { display: block; }
}
html[data-theme="light"] .sender-logo--dark { display: none; }
html[data-theme="light"] .sender-logo--light { display: block; }
html[data-theme="dark"] .sender-logo--dark { display: block; }
html[data-theme="dark"] .sender-logo--light { display: none; }

.sender-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--brg-700), var(--gold-strong));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Crimson Text', serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--cream-100);
  letter-spacing: 0.04em;
  border: 1px solid rgba(176,141,87,0.3);
}

.sender-info { flex: 1; min-width: 0; }

.sender-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--cream-100);
}

.sender-sub {
  font-size: 12px;
  color: var(--stone-500);
  margin-top: 2px;
}

/* ── Message Section ───────────────────────────────────────────────────── */

.message-section {
  padding: 18px 28px 0;
}

.message-text {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
  background: rgba(4,26,19,0.3);
  border: 1px solid rgba(249,245,236,0.07);
  border-radius: 12px;
  padding: 14px 16px;
}

/* ── Section Divider ───────────────────────────────────────────────────── */

.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(249,245,236,0.1), transparent);
  margin: 0 28px;
}

/* ── Transfer Info ─────────────────────────────────────────────────────── */

.transfer-info {
  padding: 20px 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.transfer-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--cream-100);
  line-height: 1.2;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transfer-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--stone-500);
  font-weight: 600;
  white-space: nowrap;
}
.transfer-meta i {
  color: var(--gold);
  opacity: 0.6;
  font-size: 10px;
}

/* ── File List ─────────────────────────────────────────────────────────── */

.file-list {
  padding: 16px 28px 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background 200ms var(--ease);
  cursor: pointer;
  position: relative;
}
.file-item:hover {
  background: rgba(249,245,236,0.05);
}
.file-item:hover .file-dl-btn {
  opacity: 1;
}
/* On touch devices the :hover state never fires, so the button must be
   visible at rest — otherwise customers stare at "Download all" without
   noticing per-file shortcuts. */
@media (hover: none), (pointer: coarse) {
  .file-dl-btn { opacity: 1; }
}

.file-item-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  flex-shrink: 0;
  background: rgba(176,141,87,0.12);
  border: 1px solid rgba(176,141,87,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.file-item-icon i {
  font-size: 15px;
  color: var(--gold);
}

.file-item-info { flex: 1; min-width: 0; }

.file-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--cream-200);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item-size {
  font-size: 11px;
  color: var(--stone-500);
  margin-top: 2px;
}

.file-item-path {
  font-size: 11px;
  color: var(--stone-500);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.85;
}
.file-item-path i {
  margin-right: 4px;
  opacity: 0.7;
  font-size: 10px;
}

.file-dl-btn {
  /* Default low-opacity so it's visible at rest on desktop too; fully
     visible on hover (rule above) and on touch devices (rule above). */
  opacity: 0.45;
  transition: opacity 180ms var(--ease), background 180ms var(--ease);
  width: 34px; height: 34px;
  border-radius: 8px;
  background: rgba(176,141,87,0.18);
  border: 1px solid rgba(176,141,87,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
}
.file-dl-btn:hover {
  background: rgba(176,141,87,0.25);
}

/* ── More Files Toggle ─────────────────────────────────────────────────── */

.more-files {
  padding: 12px 28px;
  font-size: 13px;
  color: var(--stone-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: color 200ms;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.more-files:hover { color: var(--gold); }
.more-files:active { color: var(--gold); opacity: 0.8; }
.more-files i { font-size: 11px; transition: transform 200ms; }

/* ── Expiry Section (progress bar) ─────────────────────────────────────── */

.expiry-section {
  padding: 20px 28px 0;
}

.expiry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.expiry-label {
  font-size: 12px;
  color: var(--stone-500);
  display: flex;
  align-items: center;
  gap: 6px;
}
.expiry-label i {
  font-size: 10px;
  color: var(--gold);
  opacity: 0.7;
}

.expiry-days {
  font-size: 12px;
  font-weight: 700;
  color: var(--cream-200);
}

.expiry-track {
  height: 4px;
  background: rgba(249,245,236,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.expiry-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-strong), var(--gold));
  border-radius: 2px;
  transition: width 1.2s ease;
}

/* ── Download Button ───────────────────────────────────────────────────── */

.download-section {
  padding: 24px 28px 28px;
}

.btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 24px;
  background: var(--gold);
  color: var(--ink);
  border: none;
  border-radius: 999px;
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 28px rgba(176,141,87,0.35);
  transition: all 220ms var(--ease);
  position: relative;
  overflow: hidden;
}
.btn-download:hover {
  background: var(--gold-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 36px rgba(176,141,87,0.48);
}
.btn-download:active {
  transform: translateY(0);
}
.btn-download .btn-size {
  opacity: 0.65;
  font-weight: 600;
  font-size: 11px;
}

/* Progress bar inside download button */
.btn-download .btn-progress {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: rgba(0,0,0,0.1);
  width: 0;
  transition: width 0.3s ease;
  pointer-events: none;
}
.btn-download.downloading {
  pointer-events: none;
}

/* ── Download Limit ────────────────────────────────────────────────────── */

.download-limit {
  margin-top: 10px;
  text-align: center;
  font-size: 11px;
  color: var(--stone-500);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.download-limit i { font-size: 10px; }

/* ── Success State ─────────────────────────────────────────────────────── */

#state-success {
  display: none;
  padding: 40px 28px;
  text-align: center;
  animation: slideUp 0.5s var(--ease) both;
}

.success-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(176,141,87,0.12);
  border: 1px solid rgba(176,141,87,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.success-icon i {
  font-size: 26px;
  color: var(--gold);
}

.success-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 8px;
}

.success-sub {
  font-size: 13px;
  color: var(--stone-500);
  line-height: 1.6;
}

/* ── Error State ───────────────────────────────────────────────────────── */

#state-error {
  display: none;
  padding: 40px 28px;
  text-align: center;
}

.error-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.error-icon i {
  font-size: 26px;
  color: #ef4444;
}

.error-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 8px;
}

.error-sub {
  font-size: 13px;
  color: var(--stone-500);
  line-height: 1.6;
}

.error-contact {
  margin-top: 16px;
  font-size: 13px;
  color: var(--gold);
  text-decoration: none;
}
.error-contact:hover {
  text-decoration: underline;
}

/* ── Password Gate ─────────────────────────────────────────────────────── */

.password-gate {
  padding: 28px 28px 24px;
  text-align: center;
}

.pw-label {
  font-size: 13px;
  color: var(--stone-500);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.pw-label i {
  color: var(--gold);
  font-size: 12px;
}

.pw-row {
  display: flex;
  gap: 8px;
}

.pw-input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(4,26,19,0.5);
  border: 1px solid rgba(249,245,236,0.14);
  border-radius: 10px;
  color: var(--cream-100);
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 200ms;
}
.pw-input:focus {
  border-color: rgba(176,141,87,0.5);
}
/* Override browser autofill highlighting */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 40px rgba(4,26,19,0.95) inset;
  -webkit-text-fill-color: var(--cream-100);
  caret-color: var(--cream-100);
}

.pw-btn {
  padding: 12px 18px;
  background: rgba(176,141,87,0.15);
  border: 1px solid rgba(176,141,87,0.3);
  border-radius: 10px;
  color: var(--gold);
  font-size: 13px;
  cursor: pointer;
  transition: background 200ms;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
}
.pw-btn:hover {
  background: rgba(176,141,87,0.25);
}

.pw-error {
  font-size: 12px;
  color: #ef4444;
  margin-top: 8px;
  display: none;
}

/* ── Footer ────────────────────────────────────────────────────────────── */

footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 24px 32px;
  animation: slideUp 0.65s 0.15s var(--ease) both;
}

.footer-brand {
  font-family: 'Crimson Text', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--gold);
  opacity: 0.5;
  letter-spacing: 0.06em;
}

.footer-text {
  font-size: 11px;
  color: var(--stone-500);
  margin-top: 4px;
}
.footer-text a {
  color: var(--stone-500);
  text-decoration: none;
}
.footer-text a:hover {
  color: var(--gold);
}

/* ── Login Card (admin login page) ─────────────────────────────────────── */

#login-card {
  padding: 36px 32px;
  max-width: 400px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Additional Components (not in prototype)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Language Switch ───────────────────────────────────────────────────── */

.lang-switch {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone-500);
  background: none;
  border: 1px solid rgba(249,245,236,0.12);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Manrope', sans-serif;
}
.lang-switch:hover {
  color: var(--gold);
  border-color: rgba(176,141,87,0.3);
}

/* ── Theme Toggle ──────────────────────────────────────────────────────── */

.theme-toggle {
  width: 30px; height: 30px; border-radius: 50%;
  background: none; border: 1px solid rgba(249,245,236,0.12);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--stone-500); font-size: 13px;
  transition: all 220ms var(--ease);
}
.theme-toggle:hover {
  color: var(--gold); border-color: rgba(176,141,87,0.3);
}

/* ── Toast Notifications ───────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  padding: 14px 20px;
  border-radius: 12px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  font-size: 13px;
  color: var(--cream-100);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.4s var(--ease);
}
.toast.show {
  transform: none;
  opacity: 1;
}
.toast.success {
  border-color: rgba(74, 222, 128, 0.3);
}
.toast.error {
  border-color: rgba(248, 113, 113, 0.3);
}
.toast-undo {
  background: none; border: none; color: var(--gold); font-size: 13px;
  font-weight: 700; cursor: pointer; margin-left: 12px; padding: 0;
  text-decoration: underline; text-underline-offset: 2px;
  font-family: inherit;
}
.toast-undo:hover { color: var(--gold-hover); }

/* ── Rainbow Progress Bar (animated) ───────────────────────────────────── */

.rainbow-progress {
  background: linear-gradient(90deg, #ff0000, #ff8800, #ffff00, #00ff00, #00ffff, #0000ff, #8800ff, #ff0000);
  background-size: 200% 100%;
  animation: rainbow-shift 2s linear infinite;
}

@keyframes rainbow-shift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ── Video Background ─────────────────────────────────────────────────── */

.video-bg {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
}
.video-bg video {
  width: 100%; height: 100%; object-fit: cover;
}
.video-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(4,26,19,0.7) 0%, rgba(4,26,19,0.85) 50%, rgba(4,26,19,0.95) 100%);
}

/* ── Delivery Card (stronger liquid glass) ────────────────────────────── */

.delivery-page .card {
  background: linear-gradient(155deg, rgba(249,245,236,0.08) 0%, rgba(249,245,236,0.03) 40%, rgba(4,26,19,0.4) 100%);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(249,245,236,0.12);
  border-radius: 24px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.12), inset 0 -1px 0 rgba(0,0,0,0.1);
}

/* ── Actio Presentation View (fullscreen iframe) ──────────────────────── */

.actio-main {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: var(--brg-950);
}

.actio-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 20px;
  background: rgba(4,26,19,0.95);
  border-bottom: 1px solid rgba(249,245,236,0.08);
  backdrop-filter: blur(16px);
  flex-shrink: 0;
  z-index: 51;
}

.actio-bar-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.actio-bar-logo {
  height: 20px;
  width: auto;
  opacity: 0.7;
}

.actio-bar-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--cream-100);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actio-bar-sender {
  font-size: 11px;
  color: var(--stone-500);
}

.actio-bar-download {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(176,141,87,0.12);
  border: 1px solid rgba(176,141,87,0.25);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all 200ms var(--ease);
}
.actio-bar-download:hover {
  background: rgba(176,141,87,0.22);
}

.actio-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #000;
}

/* Hide blobs when video background is active */
.delivery-page .blob,
.video-home .blob { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   Responsive — Mobile (max-width: 520px)
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 520px) {
  header { padding: 14px 20px; }
  .page { padding: 80px 16px 48px; }
  .card { border-radius: 20px; }
  .sender-section,
  .message-section,
  .transfer-info,
  .file-list,
  .expiry-section,
  .download-section {
    padding-left: 20px;
    padding-right: 20px;
  }
  .section-divider { margin: 0 20px; }
  .transfer-title { font-size: 18px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Homepage & Navigation
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══ Header nav ═══ */
.header-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font-size: 12px; font-weight: 600; color: var(--stone-500);
  text-decoration: none; padding: 6px 12px; border-radius: 8px;
  transition: all 200ms var(--ease);
}
.nav-link:hover { color: var(--cream-100); background: rgba(249,245,236,0.05); }
.nav-link--subtle { opacity: 0.6; }
.nav-link--subtle:hover { opacity: 1; }

.header-user {
  font-size: 12px; font-weight: 600; color: var(--cream-200);
  letter-spacing: 0.04em;
}

.btn-login {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 20px; border-radius: 999px;
  background: var(--gold); color: var(--ink);
  font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  text-decoration: none; transition: all 220ms var(--ease);
}
.btn-login:hover { background: var(--gold-hover); transform: translateY(-1px); }

/* ═══ Upload Hero (WeTransfer-style) ═══ */
.upload-hero {
  width: 100%; max-width: 560px;
}
.upload-hero-inner {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(145%);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
  padding: 40px 32px;
  animation: slideUp 0.65s var(--ease) both;
}
.hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px; font-weight: 600; color: var(--cream-100);
  text-align: center; margin-bottom: 4px;
}
.hero-sub {
  font-size: 13px; color: var(--stone-500); text-align: center; margin-bottom: 24px;
}

/* ═══ Delivery form (inline on homepage) ═══ */
.delivery-form { margin-top: 24px; }
.delivery-form .form-group { margin-bottom: 16px; }
.delivery-form .form-label {
  display: block; font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--stone-500); margin-bottom: 6px;
}
.delivery-form .form-input,
.delivery-form .form-textarea {
  width: 100%; background: rgba(4,26,19,0.3);
  border: 1px solid rgba(249,245,236,0.12);
  border-radius: 10px; padding: 10px 14px;
  color: var(--cream-100); font-family: 'Manrope', sans-serif; font-size: 13px;
}
.delivery-form .form-input:focus,
.delivery-form .form-textarea:focus {
  outline: none; border-color: rgba(176,141,87,0.4);
}
.delivery-form .form-textarea { min-height: 70px; resize: vertical; }
.delivery-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ═══ Drop zone (used on homepage + admin) ═══ */
.drop-zone {
  border: 2px dashed rgba(249,245,236,0.15); border-radius: 16px;
  padding: 40px; text-align: center; cursor: pointer;
  transition: all 300ms var(--ease); background: rgba(4,26,19,0.2);
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: rgba(176,141,87,0.5); background: rgba(176,141,87,0.05);
}
.drop-zone-icon { font-size: 28px; color: var(--gold); margin-bottom: 10px; }
.drop-zone-text { font-size: 13px; color: var(--stone-500); line-height: 1.6; }
.drop-zone-text strong { color: var(--gold); cursor: pointer; }

/* ═══ Upload items ═══ */
.upload-item {
  display: flex; flex-direction: column; gap: 6px; padding: 10px 14px;
  background: rgba(249,245,236,0.03); border: 1px solid rgba(249,245,236,0.06);
  border-radius: 10px; margin-top: 6px;
}
.upload-item-top {
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.upload-item-name {
  flex: 1; min-width: 0;
  font-size: 13px; font-weight: 600; color: var(--cream-200);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.upload-item-path {
  font-size: 11px; color: var(--stone-500);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 100%;
}
.upload-item-path i { margin-right: 4px; opacity: 0.7; }
.upload-item-bar {
  height: 4px; background: rgba(249,245,236,0.06);
  border-radius: 3px; overflow: hidden;
}
.upload-bar-fill {
  height: 100%; width: 0;
  background: var(--gold);
  border-radius: 3px; transition: width 200ms ease;
}
.upload-bar-fill.uploading {
  background: linear-gradient(90deg, var(--gold), #d4b17c);
}
.upload-item-meta {
  font-size: 11px; color: var(--stone-500); line-height: 1.4;
}
.upload-speed-inline { color: var(--stone-500); }
.upload-status {
  font-size: 12px; font-weight: 700; color: var(--stone-500);
  min-width: 42px; text-align: right; white-space: nowrap;
}
.upload-status.done { color: #4ade80; }
.upload-status.error { color: #f87171; }
.upload-remove-btn, .upload-cancel-btn {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid rgba(249,245,236,0.08);
  border-radius: 999px;
  color: var(--stone-500); cursor: pointer;
  transition: background 150ms, color 150ms, border-color 150ms;
  font-size: 11px; padding: 0;
}
.upload-remove-btn:hover, .upload-cancel-btn:hover {
  background: rgba(248,113,113,0.12);
  border-color: rgba(248,113,113,0.35);
  color: #f87171;
}

/* ═══ Footer (homepage) ═══ */
.footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 8px; }
.footer-links a { font-size: 12px; color: var(--stone-500); text-decoration: none; }
.footer-links a:hover { color: var(--gold); }
.footer-copy { font-size: 11px; color: rgba(125,127,116,0.5); }
.footer-copy a { color: inherit; text-decoration: none; }
.footer-copy a:hover { color: var(--gold); }

/* ═══ Success overlay ═══ */
.success-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(4,26,19,0.85);
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
}
.success-overlay.show { display: flex; }
.success-card {
  background: var(--glass-bg); backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border); border-radius: 24px;
  padding: 40px; text-align: center; max-width: 420px; width: 90%;
  box-shadow: var(--glass-shadow);
}
.success-link-box {
  background: rgba(4,26,19,0.4); border: 1px solid rgba(249,245,236,0.1);
  border-radius: 10px; padding: 12px 16px; font-size: 13px; color: var(--gold);
  word-break: break-all; margin: 16px 0; user-select: all;
}

/* ═══ btn-gold ═══ */
.btn-gold {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 28px; background: var(--gold); color: var(--ink);
  border: none; border-radius: 999px; font-family: 'Manrope', sans-serif;
  font-size: 13px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer; transition: all 220ms var(--ease);
}
.btn-gold:hover { background: var(--gold-hover); transform: translateY(-2px); box-shadow: 0 8px 36px rgba(176,141,87,0.4); }

/* ═══════════════════════════════════════════════════════════════════════════
   Homepage — Public visitor view (history + empty state + cookie banner)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══ Home container ═══ */
.home-container {
  width: 100%; max-width: 520px;
}

.home-card {
  padding: 0;
}

.home-header {
  padding: 36px 32px 8px;
  text-align: center;
}

.home-brand-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brg-700), var(--gold-strong));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  border: 1px solid rgba(176,141,87,0.3);
  box-shadow: 0 8px 32px rgba(176,141,87,0.15);
}
.home-brand-icon i {
  font-size: 22px; color: var(--cream-100);
}

.home-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px; font-weight: 600;
  color: var(--cream-100);
  letter-spacing: 0.02em;
}

/* ═══ Empty state ═══ */
.empty-state {
  padding: 32px 32px 40px;
  text-align: center;
}

.empty-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(249,245,236,0.04);
  border: 1px solid rgba(249,245,236,0.08);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.empty-icon i {
  font-size: 18px; color: var(--stone-500); opacity: 0.6;
}

.empty-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px; font-weight: 600;
  color: var(--cream-200);
  margin-bottom: 6px;
}

.empty-msg {
  font-size: 13px; color: var(--stone-500); line-height: 1.6;
}

/* ═══ History list ═══ */
.history-heading {
  padding: 4px 32px 8px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--stone-500);
}

.history-list {
  list-style: none; padding: 0 16px 16px; margin: 0;
  display: flex; flex-direction: column; gap: 2px;
}

.history-item {
  border-radius: 12px;
  transition: background 200ms var(--ease);
}
.history-item:hover {
  background: rgba(249,245,236,0.05);
}

.history-item-link {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  text-decoration: none; color: inherit;
}

.history-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brg-700), var(--gold-strong));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Crimson Text', serif;
  font-size: 15px; font-weight: 600;
  color: var(--cream-100);
  letter-spacing: 0.04em;
  border: 1px solid rgba(176,141,87,0.25);
}

.history-info {
  flex: 1; min-width: 0;
}

.history-name {
  font-size: 14px; font-weight: 600;
  color: var(--cream-100);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.history-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--stone-500);
  margin-top: 3px;
  flex-wrap: wrap;
}

.history-dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--stone-500); opacity: 0.5;
  flex-shrink: 0;
}

.history-open {
  font-size: 12px; font-weight: 700;
  color: var(--gold); white-space: nowrap;
  opacity: 0;
  transition: opacity 200ms var(--ease);
  display: flex; align-items: center; gap: 5px;
}
.history-open i { font-size: 10px; }
.history-item:hover .history-open { opacity: 1; }

/* ═══ Cookie consent banner ═══ */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 200;
  display: flex; justify-content: center;
  padding: 12px 16px;
  animation: slideUp 0.4s var(--ease) both;
}

.cookie-banner-inner {
  max-width: 680px; width: 100%;
  background: rgba(4,26,19,0.85);
  backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(249,245,236,0.1);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  display: flex; align-items: center; gap: 12px;
}

.cookie-text {
  flex: 1;
  font-size: 12px; line-height: 1.45;
  color: rgba(249,245,236,0.6);
}

.cookie-actions {
  display: flex; gap: 6px; flex-shrink: 0;
}

.cookie-btn {
  padding: 6px 14px;
  border-radius: 8px;
  font-family: 'Manrope', sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 180ms;
  border: none;
}

.cookie-btn--accept {
  background: var(--gold); color: var(--ink);
}
.cookie-btn--accept:hover {
  background: var(--gold-hover);
}

.cookie-btn--decline {
  background: transparent;
  color: rgba(249,245,236,0.5);
  border: none;
  padding: 6px 10px;
}
.cookie-btn--decline:hover {
  color: rgba(249,245,236,0.8);
}

/* Light mode cookie banner */
@media (prefers-color-scheme: light) and (max-width: 0) {
  .cookie-banner-inner { background: rgba(255,255,255,0.9); border-color: rgba(16,32,25,0.08); box-shadow: 0 8px 32px rgba(0,0,0,0.08); }
  .cookie-text { color: rgba(16,32,25,0.6); }
  .cookie-btn--accept { background: var(--gold-strong); color: #fff; }
  .cookie-btn--decline { color: rgba(16,32,25,0.4); }
  .cookie-btn--decline:hover { color: rgba(16,32,25,0.7); }
}
html[data-theme="light"] .cookie-banner-inner { background: rgba(255,255,255,0.92); border-color: rgba(16,32,25,0.08); box-shadow: 0 8px 32px rgba(0,0,0,0.08); backdrop-filter: blur(20px); }
html[data-theme="light"] .cookie-text { color: rgba(16,32,25,0.6); }
html[data-theme="light"] .cookie-btn--accept { background: var(--gold-strong); color: #fff; }
html[data-theme="light"] .cookie-btn--decline { color: rgba(16,32,25,0.4); }

/* ═══ Mobile overrides ═══ */
@media (max-width: 520px) {
  .upload-hero-inner { padding: 28px 20px; }
  .hero-title { font-size: 26px; }
  .delivery-form .form-row { grid-template-columns: 1fr; }
  .header-nav { display: none; }
  .footer-links { flex-direction: column; gap: 8px; }

  .home-header { padding: 28px 20px 4px; }
  .home-title { font-size: 24px; }
  .history-heading { padding-left: 20px; padding-right: 20px; }
  .history-list { padding: 0 8px 12px; }
  .history-item-link { padding: 10px 12px; }
  .history-open { opacity: 1; }

  .cookie-banner { padding: 8px 12px; }
  .cookie-banner-inner { padding: 10px 14px; gap: 10px; }
  .cookie-text { font-size: 11px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   [AUDIT FIX] Additional mobile responsive breakpoints for delivery page.
   Ensures 2-column form layouts stack, modals go full-width, and
   font sizes / padding adjust for small screens.
   ═══════════════════════════════════════════════════════════════════════════ */

/* [AUDIT FIX] Tablet breakpoint: adjust card and lightbox sizing */
@media (max-width: 768px) {
  .card { max-width: 100%; border-radius: 20px; }
  .lightbox { padding: 40px 20px 20px; }
  .lightbox-content { max-width: 95vw; }
  .lb-audio-player { width: 100%; max-width: 100%; }
  .lb-pdf { width: 95vw; height: 70vh; }
  .pw-row { flex-direction: column; }
  .pw-input { width: 100%; }
  .pw-btn { width: 100%; text-align: center; }
  .transfer-title { font-size: 20px; }
  header { padding: 14px 20px; }
  .header-right { gap: 12px; }
  .btn-download { font-size: 12px; padding: 13px 20px; }
}

/* [AUDIT FIX] Small mobile: further adjustments */
@media (max-width: 400px) {
  header { padding: 12px 14px; }
  .header-logo-img { height: 22px; }
  .page { padding: 72px 12px 40px; }
  .card { border-radius: 16px; }
  .sender-section, .message-section, .transfer-info,
  .file-list, .expiry-section, .download-section {
    padding-left: 16px; padding-right: 16px;
  }
  .section-divider { margin: 0 16px; }
  .transfer-title { font-size: 17px; }
  .file-item-name { font-size: 12px; }
  .btn-download { font-size: 11px; letter-spacing: 0.08em; }
  .success-title, .error-title { font-size: 22px; }
  .lightbox-close { top: 12px; right: 12px; width: 36px; height: 36px; }
}

/* [AUDIT FIX] Loading spinner utility class for async button states */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}
.btn-loading::after {
  content: '';
  position: absolute;
  right: 14px; top: 50%;
  width: 16px; height: 16px;
  margin-top: -8px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
}
@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

/* [AUDIT FIX] Empty state styling for delivery/file/folder lists */
.empty-state-msg {
  text-align: center;
  padding: 48px 24px;
  color: var(--stone-500);
  font-size: 14px;
  line-height: 1.6;
}
.empty-state-msg i {
  display: block;
  font-size: 36px;
  color: var(--gold);
  opacity: 0.4;
  margin-bottom: 12px;
}
