:root {
  --night: #050d1f;
  --blue: #0b2348;
  --deep: #123b68;
  --cyan: #27afcb;
  --cyan-soft: #6eebff;
  --white: #ffffff;
  --paper: #f4f8fb;
  --muted: #b8d7e8;
  --line: rgba(110, 235, 255, 0.18);
  --danger: #ff6b78;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --yc-purple: #5d248b;
  --yc-orange: #ff8f40;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--night);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--white);
  background:
    linear-gradient(180deg, rgba(39, 175, 203, 0.08), transparent 32rem),
    radial-gradient(circle at top right, rgba(110, 235, 255, 0.1), transparent 24rem),
    var(--night);
  font-family: Barlow, Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
  font-size: 16px;
}

body[dir="rtl"] {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

.microbar,
.app-header,
.microfooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 13, 31, 0.88);
  backdrop-filter: blur(16px);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
}

.microfooter {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.brandline {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.brandline img,
.microfooter img {
  width: auto;
  height: 26px;
  object-fit: contain;
}

.brandline img:last-child,
.microfooter img:last-child {
  height: 30px;
}

.language-switcher,
.header-actions,
.quick-tools,
.mission-actions,
.inline-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.language-switcher button {
  width: 42px;
  height: 34px;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 59, 104, 0.8);
  cursor: pointer;
}

.language-switcher button.is-active {
  border-color: var(--cyan-soft);
  box-shadow: 0 0 0 2px rgba(110, 235, 255, 0.16);
}

.language-switcher img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.72rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--white);
  background: rgba(18, 59, 104, 0.78);
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.btn:hover,
.btn:focus-visible {
  border-color: var(--cyan-soft);
  background: rgba(39, 175, 203, 0.2);
  outline: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  color: var(--night);
  border-color: var(--cyan-soft);
  background: var(--cyan-soft);
  font-weight: 800;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--cyan);
}

.btn-secondary {
  color: var(--white);
  background: rgba(11, 35, 72, 0.92);
}

.btn-live {
  color: var(--night);
  border-color: #ffffff;
  background: #ffffff;
  font-weight: 800;
}

.btn-danger {
  border-color: rgba(255, 107, 120, 0.55);
  color: #ffecef;
  background: rgba(255, 107, 120, 0.12);
}

.home-shell,
.dashboard-shell,
.advice-shell,
.report-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

body[data-page="home"] {
  overflow: hidden;
  background: url("../assets/images/mission-5-juillet-hero-desktop.png") center / cover no-repeat var(--night);
}

body[data-page="home"] .microbar,
body[data-page="home"] .microfooter {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 5;
  border-color: transparent;
  background: transparent;
  backdrop-filter: none;
}

body[data-page="home"] .microbar {
  top: 0;
}

body[data-page="home"] .microfooter {
  bottom: 0;
}

.home-fullscreen {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 5.5rem clamp(1rem, 4vw, 3rem) 4rem;
}

.home-choice-minimal {
  width: min(920px, 100%);
  display: grid;
  gap: 1.1rem;
  justify-items: center;
  padding: 0;
  border: 0;
  background: transparent;
}

.home-choice-minimal blockquote {
  margin: 0;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  color: #ffffff;
  font-style: italic;
  font-weight: 800;
  text-align: center;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.88), 0 1px 2px rgba(0, 0, 0, 0.9);
}

.home-choice-minimal blockquote::before {
  content: "“";
}

.home-choice-minimal blockquote::after {
  content: "”";
}

.home-choice-minimal .choice-panel {
  width: min(560px, 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

.home-cta {
  min-height: 62px;
  font-size: clamp(1rem, 2vw, 1.25rem);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
}

.home-cta svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  fill: currentColor;
}

body[data-page="home"] .home-fullscreen {
  place-items: end center;
  padding: 5.5rem clamp(1rem, 4vw, 3rem) 7.2rem;
}

body[data-page="home"] .home-choice.home-choice-minimal {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-page="home"] .home-choice-minimal .choice-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
}

body[data-page="home"] .home-cta {
  white-space: nowrap;
}

.home-live {
  min-width: min(340px, 100%);
}

.login-shell {
  width: min(720px, calc(100% - 2rem));
  min-height: calc(100vh - 86px);
  display: grid;
  place-items: center;
  margin: 0 auto;
}

.login-card {
  width: 100%;
  display: grid;
  gap: 1rem;
  padding: clamp(1.2rem, 4vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(11, 35, 72, 0.9), rgba(5, 13, 31, 0.92)),
    url("../assets/images/mission-5-juillet.png") center / cover;
  box-shadow: var(--shadow);
}

.home-hero {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue);
  box-shadow: var(--shadow);
}

.home-hero img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}

.home-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  align-items: center;
  gap: 1.5rem;
  margin-top: 1rem;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 35, 72, 0.88);
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--cyan-soft);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(2rem, 4vw, 4.3rem);
}

h2 {
  font-size: clamp(1.35rem, 2vw, 2rem);
}

h3 {
  font-size: 1.05rem;
}

blockquote {
  max-width: 760px;
  margin: 1rem 0;
  padding-inline-start: 1rem;
  border-inline-start: 4px solid var(--cyan-soft);
  color: var(--paper);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 700;
}

.lead {
  max-width: 680px;
  color: var(--muted);
}

.choice-panel {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 13, 31, 0.5);
}

.coach-code {
  display: grid;
  gap: 0.55rem;
}

.coach-code input,
.field input,
.field textarea,
.field select,
.score-table input {
  width: 100%;
  border: 1px solid rgba(184, 215, 232, 0.38);
  border-radius: 8px;
  color: var(--white);
  background: rgba(5, 13, 31, 0.72);
  padding: 0.8rem;
}

.field textarea {
  min-height: 108px;
  resize: vertical;
}

.form-error {
  min-height: 1.4em;
  margin: 0;
  color: #ffdce0;
}

.page-hero {
  position: relative;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 1.2rem;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 35, 72, 0.88);
}

.page-hero.compact img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
}

.page-hero > div {
  display: grid;
  align-content: center;
  gap: 0.75rem;
  padding: clamp(1rem, 3vw, 2rem);
}

.warning-band {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(110, 235, 255, 0.38);
  border-radius: 8px;
  color: var(--paper);
  background: rgba(39, 175, 203, 0.12);
}

.action-grid,
.advice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.action-tile,
.advice-grid article,
.check-panel,
.quick-tools,
.mission-content,
.side-panel,
.mission-tabs,
.report-page,
.export-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 35, 72, 0.78);
}

.action-tile {
  min-height: 150px;
  display: grid;
  align-content: space-between;
  gap: 0.75rem;
  padding: 1rem;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.action-tile:hover,
.action-tile:focus-visible {
  transform: translateY(-2px);
  border-color: var(--cyan-soft);
  background: rgba(18, 59, 104, 0.94);
}

.action-tile span {
  color: var(--cyan-soft);
  font-weight: 900;
}

.action-tile strong {
  font-size: 1.25rem;
}

.action-tile small {
  color: var(--muted);
  font-size: 0.96rem;
}

.action-tile.primary,
.action-tile.live {
  border-color: rgba(110, 235, 255, 0.42);
  background: rgba(39, 175, 203, 0.18);
}

.studio-tile,
body[data-page="studio-media"] .content-card,
body[data-page="studio-media"] .quick-tools {
  border-color: rgba(255, 143, 64, 0.36);
  background:
    linear-gradient(135deg, rgba(93, 36, 139, 0.5), rgba(255, 143, 64, 0.12)),
    rgba(11, 35, 72, 0.85);
}

.quick-tools,
.check-panel {
  margin-top: 1rem;
  padding: 1rem;
}

.brief-grid,
.role-grid,
.timeline-grid,
.badge-strip {
  display: grid;
  gap: 1rem;
}

.brief-grid,
.role-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.timeline-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.badge-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.content-card,
.role-card,
.timeline-card,
.badge-card,
.mission-guidance {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 35, 72, 0.78);
}

.content-card textarea {
  width: 100%;
  min-height: 160px;
  border: 1px solid rgba(184, 215, 232, 0.38);
  border-radius: 8px;
  color: var(--white);
  background: rgba(5, 13, 31, 0.58);
  padding: 0.8rem;
}

.role-card {
  position: relative;
  display: grid;
  gap: 0.65rem;
  align-content: start;
}

.role-card-natural {
  overflow: hidden;
  padding: 0;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(6, 18, 39, 0.96), rgba(5, 13, 31, 0.98)),
    radial-gradient(circle at 85% 15%, rgba(110, 235, 255, 0.12), transparent 36%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.role-card-natural::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
}

.role-card-natural.is-selected {
  border-color: var(--cyan-soft);
  box-shadow: 0 0 0 2px rgba(110, 235, 255, 0.25), 0 22px 46px rgba(0, 0, 0, 0.34);
}

.role-select {
  position: relative;
  display: grid;
  gap: 0;
  width: 100%;
  padding: 0;
  border: 0;
  color: var(--white);
  text-align: start;
  background: transparent;
  cursor: pointer;
}

.role-select img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.role-card__title {
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.8rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(110, 235, 255, 0.24);
  border-radius: 8px;
  background: rgba(5, 13, 31, 0.68);
  font-weight: 800;
}

.role-card__body {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
}

.role-card__body p {
  margin: 0;
  color: var(--muted);
}

.role-card__body strong {
  color: var(--white);
}

.role-owner {
  margin-top: 0.35rem;
}

.role-icon {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: var(--night);
  background: var(--cyan-soft);
  font-weight: 900;
}

.mission-guidance {
  margin: 0 0 1rem;
}

.mission-guidance h3 {
  color: var(--cyan-soft);
  margin-bottom: 0.35rem;
}

.mission-guidance ul {
  margin: 0;
  padding-inline-start: 1.25rem;
  color: var(--muted);
}

.mission-content[data-active-tab="media_trace"],
.mission-content[data-active-tab="studio"] {
  border-color: rgba(255, 143, 64, 0.45);
  background:
    linear-gradient(135deg, rgba(93, 36, 139, 0.42), rgba(255, 143, 64, 0.16)),
    rgba(11, 35, 72, 0.86);
}

.check-panel ul,
.advice-grid ul,
.advice-grid ol {
  margin: 0.8rem 0 0;
  padding-inline-start: 1.25rem;
  color: var(--muted);
}

.mission-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 300px;
  gap: 1rem;
  width: min(1500px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

.mission-tabs,
.side-panel {
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 108px);
  overflow: auto;
  padding: 0.8rem;
}

.mission-tabs {
  display: grid;
  gap: 0.45rem;
  align-content: start;
}

.tab-button {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 0.65rem;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--white);
  text-align: start;
  background: transparent;
  cursor: pointer;
}

.tab-button:hover,
.tab-button.is-active {
  border-color: var(--cyan-soft);
  background: rgba(39, 175, 203, 0.15);
}

.tab-button span {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  color: var(--night);
  background: var(--cyan-soft);
  font-weight: 900;
}

.mission-content {
  min-width: 0;
  padding: clamp(1rem, 2vw, 1.6rem);
}

.mission-content header {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.mission-visual {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.fields-grid {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field label {
  color: var(--paper);
  font-weight: 800;
}

.field small,
.helper {
  color: var(--muted);
}

.repeater-list {
  display: grid;
  gap: 0.75rem;
}

.repeater-item {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 13, 31, 0.34);
}

.upload-preview {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.upload-preview img {
  width: min(360px, 100%);
  max-height: 220px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.checklist label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 13, 31, 0.32);
}

.mission-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: space-between;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.progress-fill {
  height: 100%;
  background: var(--cyan-soft);
}

.side-panel {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.mini-card,
.character-card {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 13, 31, 0.38);
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.character-card strong {
  display: block;
  margin-bottom: 0.3rem;
}

.report-shell {
  max-width: 1320px;
}

.report-pages {
  display: grid;
  gap: 1rem;
}

.report-page,
.export-card {
  padding: 1rem;
}

.report-page h2 {
  margin-bottom: 0.8rem;
  color: var(--cyan-soft);
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.report-field {
  min-height: 76px;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 13, 31, 0.34);
  white-space: pre-wrap;
}

.report-field img {
  max-height: 240px;
  object-fit: cover;
  border-radius: 8px;
}

.advice-grid article {
  padding: 1rem;
}

.quote-card {
  border-color: rgba(110, 235, 255, 0.42);
  background: rgba(39, 175, 203, 0.16);
}

.score-table {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 0.55rem;
  align-items: center;
  margin-top: 0.8rem;
}

.score-table input {
  padding: 0.45rem;
}

#print-root {
  display: none;
}

.print-logo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.print-logo-row img {
  height: 34px;
  width: auto;
  object-fit: contain;
}

@media (max-width: 1100px) {
  .mission-shell {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .side-panel {
    position: static;
    grid-column: 1 / -1;
    max-height: none;
  }
}

@media (max-width: 820px) {
  body[data-page="home"] {
    overflow: auto;
    background: url("../assets/images/mission-5-juillet-hero-mobile.png") center / cover no-repeat var(--night);
  }

  .microbar,
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-choice,
  .page-hero,
  .mission-shell,
  .action-grid,
  .advice-grid,
  .report-grid,
  .brief-grid,
  .role-grid,
  .timeline-grid,
  .badge-strip,
  .home-choice-minimal .choice-panel {
    grid-template-columns: 1fr;
  }

  .mission-tabs {
    position: static;
    max-height: none;
  }

  .repeater-item,
  .checklist {
    grid-template-columns: 1fr;
  }

  .brandline {
    flex-wrap: wrap;
  }
}
