:root {
  --bg: #081411;
  --bg-2: #10201b;
  --bg-3: #142925;
  --surface: rgba(11, 24, 20, 0.72);
  --surface-strong: rgba(15, 31, 26, 0.92);
  --stroke: rgba(216, 196, 164, 0.14);
  --text: #f6f0e6;
  --muted: #bba98e;
  --accent: #df8a4e;
  --accent-2: #f2c572;
  --danger: #d16060;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  --radius: 28px;
  --radius-md: 22px;
  --radius-sm: 18px;
  --font-display: "Aptos Display", "Palatino Linotype", "Book Antiqua", serif;
  --font-body: "Aptos", "Segoe UI", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(86, 184, 138, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(223, 138, 78, 0.16), transparent 30%),
    linear-gradient(140deg, var(--bg) 0%, var(--bg-2) 54%, var(--bg-3) 100%);
  font-family: var(--font-body);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.2;
  pointer-events: none;
}

.ambient {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.4;
  pointer-events: none;
  animation: drift 14s ease-in-out infinite;
}

.ambient-a {
  top: 4rem;
  left: -4rem;
  width: 18rem;
  height: 18rem;
  background: radial-gradient(circle, rgba(86, 184, 138, 0.35), transparent 68%);
}

.ambient-b {
  top: 28%;
  right: -5rem;
  width: 20rem;
  height: 20rem;
  background: radial-gradient(circle, rgba(242, 197, 114, 0.24), transparent 66%);
  animation-delay: -4s;
}

.ambient-c {
  bottom: 8%;
  left: 22%;
  width: 14rem;
  height: 14rem;
  background: radial-gradient(circle, rgba(223, 138, 78, 0.22), transparent 70%);
  animation-delay: -8s;
}

.layout,
.login-layout {
  position: relative;
  z-index: 1;
}

.layout {
  max-width: 1380px;
  margin: 0 auto;
  padding: 28px 18px 120px;
  display: grid;
  gap: 20px;
}

.login-layout {
  max-width: 1180px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 18px 32px;
  display: grid;
  gap: 20px;
  align-items: center;
}

.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel:not(.hero):not(.login-card) {
  padding: 24px;
}

.hero {
  position: relative;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.9fr);
  padding: 24px;
  overflow: hidden;
}

.hero::after,
.login-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(242, 197, 114, 0.12), transparent 42%);
  pointer-events: none;
}

.hero-copy-block,
.hero-side,
.login-card > * {
  position: relative;
  z-index: 1;
}

.hero h1,
.login-story h1,
.login-card h2,
.section-title h2 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.04em;
}

.hero h1,
.login-story h1 {
  font-size: clamp(2.3rem, 4vw, 4.8rem);
  line-height: 0.92;
  max-width: 12ch;
}

.login-card h2,
.section-title h2 {
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.hero-copy,
.muted {
  color: var(--muted);
}

.hero-copy {
  max-width: 62ch;
  line-height: 1.55;
}

.eyebrow,
.section-kicker,
.micro-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--accent-2);
  font-size: 0.78rem;
}

.micro-label {
  font-size: 0.7rem;
  color: rgba(246, 240, 230, 0.58);
}

.hero-badges,
.hero-actions,
.inline-actions,
.document-actions,
.document-meta,
.status-highlight {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-badges {
  margin-top: 18px;
}

.hero-pill,
.status-pill,
.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.92rem;
}

.hero-side {
  display: flex;
  align-items: stretch;
}

.hero-side-card,
.highlight-card,
.status-card,
.document-card,
.upload-dropzone,
.schedule-row,
.toggle-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.hero-side-card {
  width: 100%;
  padding: 20px;
  border-radius: var(--radius-md);
  display: grid;
  gap: 12px;
  align-content: start;
}

.hero-runtime {
  font-size: clamp(1.6rem, 2.2vw, 2.1rem);
  line-height: 1;
}

.hero-line {
  margin: 0;
}

.hero-actions {
  margin-top: auto;
}

.button {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  min-height: 46px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease,
    background 160ms ease;
}

.button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.18), transparent 80%);
  transform: translateX(-120%);
  transition: transform 320ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:hover::after {
  transform: translateX(120%);
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #14110d;
  box-shadow: 0 12px 26px rgba(223, 138, 78, 0.28);
}

.button-secondary {
  background: linear-gradient(135deg, rgba(87, 184, 138, 0.84), rgba(71, 210, 162, 0.72));
  color: #081411;
  box-shadow: 0 12px 26px rgba(71, 210, 162, 0.18);
}

.button-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 18px;
}

.section-title p {
  margin: 0;
}

.status-highlight {
  margin-bottom: 18px;
}

.status-pill.is-good {
  background: rgba(70, 192, 133, 0.16);
  border-color: rgba(70, 192, 133, 0.32);
}

.status-pill.is-warn {
  background: rgba(223, 138, 78, 0.18);
  border-color: rgba(223, 138, 78, 0.3);
}

.status-pill.is-neutral {
  background: rgba(255, 255, 255, 0.06);
}

.status-grid,
.dashboard-grid {
  display: grid;
  gap: 18px;
}

.status-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.status-card {
  padding: 18px;
  border-radius: var(--radius-sm);
  display: grid;
  gap: 8px;
  animation: liftIn 480ms ease both;
}

.status-card span {
  color: var(--muted);
  font-size: 0.82rem;
}

.status-card strong {
  font-size: 1.12rem;
  line-height: 1.3;
}

.status-card.tone-good {
  box-shadow: inset 0 0 0 1px rgba(70, 192, 133, 0.12);
}

.status-card.tone-warn {
  box-shadow: inset 0 0 0 1px rgba(223, 138, 78, 0.12);
}

.status-card.tone-danger {
  box-shadow: inset 0 0 0 1px rgba(209, 96, 96, 0.14);
}

.dashboard-grid {
  grid-template-columns: minmax(300px, 0.92fr) minmax(300px, 1.08fr);
}

.qr-wrapper {
  min-height: 360px;
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.06), transparent 58%),
    rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
}

.qr-frame {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.qr-wrapper img {
  width: min(320px, 100%);
  max-width: 100%;
  background: #fff;
  padding: 18px;
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
  animation: floatCard 5.4s ease-in-out infinite;
}

.qr-placeholder {
  max-width: 24rem;
  text-align: center;
  color: var(--muted);
}

.toggle-row,
.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.toggle-card {
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
}

.field span,
.toggle-row span {
  font-weight: 700;
}

.field-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  padding: 14px 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(242, 197, 114, 0.38);
  box-shadow: 0 0 0 4px rgba(242, 197, 114, 0.08);
}

input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

textarea {
  min-height: 260px;
  resize: vertical;
}

.schedule-grid {
  display: grid;
  gap: 12px;
}

.schedule-row {
  display: grid;
  gap: 12px;
  grid-template-columns: 84px 1fr 1fr 1fr;
  align-items: center;
  padding: 14px;
  border-radius: var(--radius-sm);
}

.schedule-day {
  font-weight: 700;
}

.schedule-row label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.upload-box {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.upload-dropzone {
  min-height: 150px;
  border-radius: var(--radius-md);
  padding: 20px;
  display: grid;
  place-items: center;
  text-align: center;
  border-style: dashed;
}

.upload-title {
  font-weight: 700;
}

.upload-subtitle {
  color: var(--muted);
}

.upload-dropzone input[type="file"] {
  margin-top: 12px;
}

.document-list {
  display: grid;
  gap: 12px;
}

.document-card {
  padding: 16px;
  border-radius: var(--radius-sm);
  display: grid;
  gap: 12px;
  animation: liftIn 480ms ease both;
}

.document-path {
  font-weight: 700;
  word-break: break-word;
}

.document-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.meta-chip {
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 94px;
  z-index: 40;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(14, 26, 22, 0.92);
  color: var(--text);
  padding: 14px 18px;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.34);
  animation: toastIn 220ms ease;
}

.hidden {
  display: none !important;
}

.mobile-dock {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 30;
  width: min(96vw, 540px);
  padding: 10px;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background: rgba(10, 20, 17, 0.84);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
}

.dock-button {
  border: 0;
  min-height: 46px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font: inherit;
  font-weight: 700;
}

.dock-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #14110d;
}

.dock-secondary {
  background: linear-gradient(135deg, rgba(87, 184, 138, 0.84), rgba(71, 210, 162, 0.72));
  color: #081411;
}

.login-layout {
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
}

.login-story {
  position: relative;
  z-index: 1;
  padding: 24px 8px;
}

.login-highlights {
  margin-top: 22px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.highlight-card {
  padding: 18px;
  border-radius: var(--radius-md);
  display: grid;
  gap: 8px;
}

.highlight-card strong {
  font-size: 1rem;
  line-height: 1.4;
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin-left: auto;
  padding: 28px;
}

.login-form {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.login-button {
  width: 100%;
}

.error-text {
  min-height: 1.25rem;
  color: var(--danger);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  animation: revealUp 620ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.reveal-1 { animation-delay: 80ms; }
.reveal-2 { animation-delay: 140ms; }
.reveal-3 { animation-delay: 200ms; }
.reveal-4 { animation-delay: 260ms; }
.reveal-5 { animation-delay: 320ms; }
.reveal-6 { animation-delay: 380ms; }

@keyframes revealUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(12px, -18px, 0) scale(1.06); }
}

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes liftIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@media (max-width: 1120px) {
  .hero,
  .dashboard-grid,
  .login-layout,
  .login-highlights {
    grid-template-columns: 1fr;
  }

  .login-card {
    margin-left: 0;
    max-width: none;
  }
}

@media (max-width: 820px) {
  .layout {
    padding: 18px 14px 110px;
  }

  .hero,
  .panel:not(.login-card),
  .login-card {
    padding: 18px;
  }

  .section-title {
    align-items: start;
    flex-direction: column;
  }

  .hero-actions {
    display: none;
  }

  .mobile-dock {
    display: grid;
  }

  .schedule-row,
  .toggle-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .hero h1,
  .login-story h1 {
    max-width: none;
    font-size: clamp(2rem, 10vw, 3.2rem);
  }

  .hero-side-card,
  .status-card,
  .document-card {
    padding: 16px;
  }

  .toast {
    bottom: 88px;
  }

  .dock-button {
    font-size: 0.9rem;
  }
}
