/* École-Amélie · Download page · single-viewport ultra optimisé */

body.download-mode {
  margin: 0;
  background: #061227;
  overflow: hidden;
}

.download-immersive {
  position: relative;
  height: 100vh;
  width: 100%;
  background:
    radial-gradient(circle at 15% 15%, rgba(0,127,255,0.45) 0%, transparent 50%),
    radial-gradient(circle at 85% 85%, rgba(247,209,23,0.30) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(206,17,38,0.15) 0%, transparent 60%),
    linear-gradient(180deg, #061227 0%, #0a1f44 50%, #061227 100%);
  color: #fff;
  overflow: hidden;
}

.bg-orbs { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5; animation: float 18s ease-in-out infinite; }
.orb-1 { width: 280px; height: 280px; top: -60px; left: -60px; background: #007FFF; }
.orb-2 { width: 240px; height: 240px; bottom: -50px; right: -50px; background: #F7D117; animation-delay: -6s; }
.orb-3 { width: 200px; height: 200px; top: 40%; left: 50%; background: #CE1126; opacity: 0.3; animation-delay: -12s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -25px) scale(1.05); }
  66% { transform: translate(-25px, 30px) scale(0.95); }
}

/* Shell : 100vh layout */
.dl-shell {
  position: relative;
  z-index: 2;
  height: 100vh;
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 28px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
}

/* Top bar slim */
.dl-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}
.dl-bar-brand { display: flex; align-items: center; gap: 12px; }
.dl-bar-1 { font-family: var(--serif); font-size: 13px; font-weight: 600; color: #fff; letter-spacing: -0.005em; }
.dl-bar-2 { font-size: 10px; color: rgba(255,255,255,0.55); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 2px; }
.dl-bar-link {
  font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 7px 14px;
  border-radius: 999px;
  text-decoration: none;
  transition: all .2s;
}
.dl-bar-link:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* Main grid : 2 cols */
.dl-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  min-height: 0;
  align-items: stretch;
}

/* Left column */
.dl-left {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  min-height: 0;
  animation: dlFadeUp .7s cubic-bezier(.4,0,.2,1);
}
.dl-left-text { padding-top: 4px; }
.dl-eyebrow {
  display: inline-block;
  padding: 5px 12px;
  background: rgba(247,209,23,0.18);
  color: #F7D117;
  border: 1px solid rgba(247,209,23,0.4);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.dl-h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 4.5vw, 50px);
  font-weight: 700;
  line-height: 1.05;
  margin: 0 0 8px;
  letter-spacing: -0.025em;
  color: #fff;
}
.dl-h1-soft { color: rgba(255,255,255,0.4); margin: 0 12px; font-weight: 400; }
.dl-h1-italic {
  background: linear-gradient(135deg, #F7D117 0%, #FFE57F 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic; font-weight: 600;
}
.dl-sub { font-size: 14px; color: rgba(255,255,255,0.75); margin: 0; line-height: 1.5; font-weight: 400; }

/* Phone mockup */
.dl-phone-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
}
.dl-phone {
  width: 260px;
  height: 100%;
  max-height: 540px;
  background: linear-gradient(160deg, #1a1f2e 0%, #0a0d18 100%);
  border-radius: 32px;
  padding: 12px;
  box-shadow:
    0 24px 60px rgba(0,0,0,0.5),
    0 0 0 2px rgba(255,255,255,0.06),
    inset 0 1px 0 rgba(255,255,255,0.1);
  position: relative;
  animation: phoneFloat 6s ease-in-out infinite;
  transform: rotate(-3deg);
  flex: 0 0 auto;
}
@keyframes phoneFloat {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50% { transform: rotate(-3deg) translateY(-8px); }
}
.dl-phone-notch {
  position: absolute; top: 12px; left: 50%;
  transform: translateX(-50%);
  width: 90px; height: 18px;
  background: #000;
  border-radius: 0 0 12px 12px;
  z-index: 2;
}
.dl-phone-screen {
  background: #FAF7F0;
  border-radius: 22px;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Mock content (already sized down) */
.dl-mock-topbar {
  background: linear-gradient(135deg, #007FFF 0%, #0066CC 100%);
  color: white;
  padding: 30px 14px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  flex-shrink: 0;
}
.dl-mock-clock { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.dl-mock-step { font-weight: 800; font-family: var(--serif); }
.dl-mock-progress { height: 2px; background: rgba(0,0,0,0.05); overflow: hidden; flex-shrink: 0; }
.dl-mock-progress-fill { height: 100%; width: 50%; background: linear-gradient(90deg, #F7D117, #007FFF); animation: mockProgress 4s ease-in-out infinite; }
@keyframes mockProgress { 0%, 100% { width: 33%; } 50% { width: 36%; } }

.dl-mock-content { padding: 14px 14px 8px; flex: 1; min-height: 0; overflow: hidden; }
.dl-mock-eyebrow {
  font-size: 9px; font-weight: 800; color: #007FFF;
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 6px;
  animation: cardSlide .4s cubic-bezier(.4,0,.2,1) backwards .2s;
}
.dl-mock-visual {
  display: flex; justify-content: center; gap: 2px;
  padding: 12px;
  background: linear-gradient(135deg, #FEF7DC 0%, #FFE5A3 100%);
  border-radius: 12px;
  margin: 0 0 10px;
  font-size: 26px;
  line-height: 1;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.04);
  animation: cardSlide .5s cubic-bezier(.4,0,.2,1) backwards .35s;
}
.dl-mock-listen {
  display: inline-flex; align-items: center; gap: 5px;
  background: #E6F3FF; color: #0066CC;
  padding: 5px 10px; border-radius: 999px;
  font-size: 10px; font-weight: 700;
  margin-bottom: 8px;
  animation: cardSlide .5s cubic-bezier(.4,0,.2,1) backwards .45s;
}
.dl-mock-question { font-family: var(--serif); font-weight: 600; color: #0f172a; line-height: 1.3; letter-spacing: -0.005em; }
.dl-mock-question-small { font-size: 14px !important; margin: 0 0 10px !important; animation: cardSlide .5s cubic-bezier(.4,0,.2,1) backwards .55s; }
.dl-mock-options-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.dl-mock-options-grid .dl-mock-opt {
  text-align: center;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  padding: 10px;
}
.dl-mock-opt {
  background: white;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  animation: cardSlide .5s cubic-bezier(.4,0,.2,1) backwards;
}
.dl-mock-opt:nth-child(1) { animation-delay: .65s; }
.dl-mock-opt:nth-child(2) { animation-delay: .72s; }
.dl-mock-opt:nth-child(3) { animation-delay: .79s; }
.dl-mock-opt:nth-child(4) { animation-delay: .86s; }
.dl-mock-opt.selected {
  border-color: #007FFF;
  background: #E6F3FF;
  color: #0066CC;
  box-shadow: 0 4px 14px rgba(0,127,255,0.2);
  transform: translateY(-1px);
}
.dl-mock-footer {
  display: flex; gap: 6px;
  padding: 8px 12px 10px;
  border-top: 1px solid #f1f5f9;
  flex-shrink: 0;
}
.dl-mock-pill {
  flex: 1; text-align: center;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  background: #f1f5f9; color: #64748b;
}
.dl-mock-pill.primary {
  background: linear-gradient(135deg, #007FFF, #0066CC);
  color: white;
  box-shadow: 0 3px 10px rgba(0,127,255,0.35);
}

/* Right column — 2 cards */
.dl-right {
  display: grid;
  grid-template-rows: 1fr 1.1fr;
  gap: 14px;
  min-height: 0;
  animation: dlFadeUp .9s cubic-bezier(.4,0,.2,1);
}

.dl-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 20px;
  padding: 18px 20px;
  backdrop-filter: blur(20px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.dl-card-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.dl-card-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F7D117 0%, #E5BE0A 100%);
  color: #0F2F4D;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.dl-card-head h2 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  color: #fff;
}
.dl-card-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }

/* Wi-Fi card */
.dl-wifi-row-h {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}
.dl-wifi-info { display: flex; flex-direction: column; gap: 12px; }
.dl-wifi-line { display: flex; flex-direction: column; gap: 2px; }
.dl-wifi-key { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.5); }
.dl-wifi-val {
  font-family: var(--serif);
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.dl-wifi-pwd {
  font-family: "SF Mono", Menlo, monospace;
  font-size: 18px;
  font-weight: 700;
  color: #F7D117;
  letter-spacing: 0.04em;
  background: rgba(247,209,23,0.1);
  border: 1.5px dashed rgba(247,209,23,0.5);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  user-select: all;
  transition: all .2s;
  display: inline-block;
  text-align: center;
  width: fit-content;
}
.dl-wifi-pwd:hover { background: rgba(247,209,23,0.2); transform: translateY(-1px); }
.dl-wifi-pwd.copied { background: #2ea44f; color: white; border-color: #2ea44f; border-style: solid; }
.dl-wifi-pwd.copied::after { content: " ✓"; }

.dl-wifi-qrmini {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
}
.dl-wifi-qrmini img {
  width: 100px; height: 100px;
  background: white;
  padding: 6px;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
  display: block;
}
.dl-wifi-qrmini span {
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.06em; text-transform: uppercase;
}

/* APK card */
.dl-apk-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}
.dl-qr-frame {
  position: relative;
  background: white;
  padding: 12px;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0,127,255,0.3);
  animation: qrPulse 3s ease-in-out infinite;
  width: fit-content;
}
@keyframes qrPulse {
  0%, 100% { box-shadow: 0 12px 30px rgba(0,127,255,0.3); }
  50% { box-shadow: 0 16px 40px rgba(0,127,255,0.5); }
}
.dl-qr-img {
  display: block;
  width: 130px;
  height: 130px;
  border-radius: 4px;
}
.dl-qr-corners { position: absolute; inset: 8px; pointer-events: none; }
.qr-corner { position: absolute; width: 18px; height: 18px; border: 3px solid #F7D117; border-radius: 3px; }
.qr-corner.tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.qr-corner.tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.qr-corner.bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.qr-corner.br { bottom: 0; right: 0; border-left: 0; border-top: 0; }

.dl-apk-side { display: flex; flex-direction: column; gap: 6px; }
.dl-apk-label { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.55); }
.dl-apk-link {
  font-family: "SF Mono", Menlo, monospace;
  font-size: 14px;
  font-weight: 700;
  background: white;
  color: #0F2F4D;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  user-select: all;
  transition: all .2s;
  word-break: break-all;
  text-align: center;
}
.dl-apk-link:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,0.2); }
.dl-apk-link.copied { background: #2ea44f; color: white; }
.dl-apk-link.copied::after { content: " ✓"; font-weight: 700; }
.dl-apk-hint { font-size: 11px; color: rgba(255,255,255,0.45); }

/* Footer */
.dl-bar-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 10px;
}
.dl-bar-footer .dim { color: rgba(255,255,255,0.3); }

@keyframes dlFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes cardSlide {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Responsive — phones et tablets en stack ─── */
@media (max-width: 980px) {
  body.download-mode { overflow: auto; }
  .download-immersive { height: auto; min-height: 100vh; }
  .dl-shell { height: auto; min-height: 100vh; padding: 16px 20px; }
  .dl-grid { grid-template-columns: 1fr; gap: 20px; }
  .dl-phone { height: auto; max-height: none; }
  .dl-phone-screen { height: 460px; }
  .dl-right { grid-template-rows: auto auto; }
}
@media (max-width: 600px) {
  .dl-h1 { font-size: 32px; }
  .dl-h1-soft { display: none; }
  .dl-h1-italic { display: block; }
  .dl-bar-link { display: none; }
  .dl-apk-row { grid-template-columns: 1fr; }
  .dl-qr-frame { margin: 0 auto; }
  .dl-bar-footer { flex-direction: column; gap: 4px; text-align: center; }
}
