:root {
  --bg: #0f1720;
  --bg-accent: #162533;
  --card: rgba(12, 24, 35, 0.88);
  --card-border: rgba(145, 182, 201, 0.18);
  --text: #eff6ff;
  --muted: #98a9b8;
  --primary: #f97316;
  --primary-strong: #ea580c;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #facc15;
  --chip: rgba(59, 130, 246, 0.16);
  --shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(249, 115, 22, 0.16), transparent 30%),
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.1), transparent 28%),
    linear-gradient(160deg, var(--bg), #091018 72%);
}

.shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 24px 28px;
  margin-bottom: 24px;
  border: 1px solid rgba(249, 115, 22, 0.15);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(16, 31, 44, 0.9), rgba(8, 15, 22, 0.92));
  box-shadow: var(--shadow);
}

.hero h1,
.section-header h2,
.timeline-head h3 {
  margin: 0;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.95;
  max-width: 560px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #ffb37a;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
}

.subtle,
.empty-state,
.timeline-head p,
.field small,
.meta-label {
  color: var(--muted);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pill {
  display: grid;
  gap: 4px;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

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

.wide {
  grid-column: 1 / -1;
}

.card {
  padding: 24px;
  border-radius: 28px;
  border: 1px solid var(--card-border);
  background: var(--card);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.auth-card {
  max-width: 520px;
}

.section-header {
  margin-bottom: 18px;
}

.stack-lg {
  display: grid;
  gap: 16px;
}

.two-col,
.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.92rem;
  color: #d6e1ea;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(249, 115, 22, 0.6);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.12);
}

.primary-button,
.danger-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 14px 20px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: white;
  box-shadow: 0 16px 30px rgba(249, 115, 22, 0.28);
}

.danger-button {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.32);
}

.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.primary-button:hover,
.danger-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.flash {
  padding: 14px 18px;
  border-radius: 18px;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

.flash-success {
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.24);
}

.flash-error {
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.24);
}

.package-block {
  margin: 18px 0 20px;
}

.chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.chip {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--chip);
  color: #c7ddff;
  border: 1px solid rgba(96, 165, 250, 0.2);
  font-size: 0.9rem;
}

.timeline {
  display: grid;
  gap: 14px;
}

.device-grid {
  display: grid;
  gap: 16px;
}

.device-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.device-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.device-presence-text {
  margin-top: 8px;
  color: #d6e1ea;
}

.app-picker {
  max-height: 280px;
  overflow: auto;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 10px;
}

.app-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.app-option input {
  margin-top: 2px;
}

.app-option span {
  display: grid;
  gap: 4px;
}

.app-option small {
  color: var(--muted);
}

.timeline-item {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.timeline-head p {
  margin: 6px 0 0;
}

.state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.state-active {
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

.state-online {
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

.state-offline {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}

.state-upcoming {
  background: rgba(250, 204, 21, 0.15);
  color: #fde68a;
}

.state-completed {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}

@media (max-width: 900px) {
  .hero,
  .grid,
  .two-col,
  .meta-grid,
  .timeline-head {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .hero {
    padding: 22px;
  }

  .shell {
    width: min(100% - 20px, 1200px);
    padding-top: 20px;
  }
}
