:root {
  color-scheme: dark;
  --bg: #070a0f;
  --panel: rgba(255, 255, 255, 0.065);
  --panel-strong: rgba(255, 255, 255, 0.105);
  --line: rgba(209, 228, 255, 0.18);
  --text: rgba(248, 251, 255, 0.94);
  --muted: rgba(226, 237, 250, 0.64);
  --soft: rgba(226, 237, 250, 0.42);
  --accent: #9dccff;
  --accent-strong: #c4e3ff;
  --warn: #d8e7ff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100svh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -10%, rgba(130, 182, 255, 0.24), transparent 36rem),
    radial-gradient(circle at 88% 22%, rgba(167, 209, 255, 0.08), transparent 18rem),
    linear-gradient(180deg, #080d14 0%, #06090e 48%, #040609 100%);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.sie-shell {
  position: relative;
  width: min(100%, 520px);
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(18px, 5vw, 30px);
  overflow: hidden;
}

.sie-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    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: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 74%);
}

.status-area {
  position: relative;
  min-height: 42svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 0 18px;
}

.ambient-grid {
  position: absolute;
  inset: 54px 12px auto;
  height: 220px;
  border: 1px solid rgba(222, 239, 255, 0.08);
  border-radius: 28px;
  background:
    linear-gradient(90deg, transparent 49%, rgba(204, 226, 255, 0.08) 50%, transparent 51%),
    linear-gradient(transparent 49%, rgba(204, 226, 255, 0.08) 50%, transparent 51%);
  background-size: 76px 76px;
  opacity: 0.72;
  transform: perspective(420px) rotateX(58deg) translateY(-18px);
  filter: blur(0.2px);
}

.system-pill,
.sync-panel,
.intro-card,
.notice-card,
.setup-card,
.home-tile,
.legal-dialog {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.system-pill {
  position: relative;
  z-index: 2;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(157, 204, 255, 0.95);
  animation: pulse 3.8s ease-in-out infinite;
}

.identity {
  position: relative;
  z-index: 2;
  padding: 54px 0 34px;
}

.product-mark {
  display: block;
  margin-bottom: 16px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

h1 {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(2.55rem, 14vw, 4.9rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.identity p,
.intro-card p,
.notice-card p,
.sync-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.65;
}

.identity p {
  max-width: 31ch;
  margin-top: 18px;
}

.sync-panel {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 24px;
}

.sync-panel strong,
.notice-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.92rem;
  font-weight: 600;
}

.sync-ring {
  position: relative;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border: 1px solid rgba(157, 204, 255, 0.28);
  border-radius: 50%;
}

.sync-ring span {
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(157, 204, 255, 0.2);
  border-radius: 50%;
}

.sync-ring span:nth-child(2) {
  inset: 17px;
  background: rgba(157, 204, 255, 0.6);
  box-shadow: 0 0 24px rgba(157, 204, 255, 0.5);
}

.sync-ring span:nth-child(3) {
  inset: -1px;
  border-color: transparent;
  border-top-color: rgba(196, 227, 255, 0.66);
  animation: rotate 8s linear infinite;
}

.intro-card,
.notice-card,
.setup-card {
  position: relative;
  z-index: 2;
  margin-top: 14px;
  border-radius: 28px;
  animation: rise 900ms ease both;
}

.intro-card {
  padding: 22px;
}

.sie-line {
  margin-bottom: 12px !important;
  color: var(--text) !important;
  font-weight: 600;
}

.capability-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.capability-list span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(209, 228, 255, 0.13);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.78rem;
}

.notice-card {
  display: flex;
  gap: 14px;
  padding: 16px;
}

.legal-link {
  width: fit-content;
  min-height: 32px;
  margin-top: 12px;
  border: 1px solid rgba(209, 228, 255, 0.16);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(196, 227, 255, 0.88);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
}

.notice-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid rgba(216, 231, 255, 0.32);
  border-radius: 50%;
  background:
    linear-gradient(var(--warn), var(--warn)) center / 2px 13px no-repeat,
    radial-gradient(circle, rgba(216, 231, 255, 0.28), transparent 60%);
}

.setup-card {
  padding: 18px;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  color: rgba(248, 251, 255, 0.78);
  font-size: 0.86rem;
  font-weight: 600;
}

input {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(209, 228, 255, 0.16);
  border-radius: 18px;
  outline: none;
  padding: 0 15px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.18);
  transition: border-color 240ms ease, box-shadow 240ms ease, background 240ms ease;
}

input::placeholder {
  color: rgba(226, 237, 250, 0.36);
}

input:focus {
  border-color: rgba(157, 204, 255, 0.62);
  background: rgba(8, 15, 24, 0.62);
  box-shadow: 0 0 0 4px rgba(157, 204, 255, 0.08);
}

form button {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(157, 204, 255, 0.46);
  border-radius: 18px;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(157, 204, 255, 0.26), rgba(255, 255, 255, 0.08));
  color: var(--text);
  font-weight: 700;
  transition: transform 240ms ease, border-color 240ms ease, background 240ms ease;
}

form button:active,
.home-tile:active {
  transform: scale(0.985);
}

form button svg,
.home-tile svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding-bottom: 12px;
}

.home-tile {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  border-radius: 22px;
  padding: 15px;
  cursor: default;
  color: rgba(248, 251, 255, 0.82);
}

.home-tile span {
  font-size: 0.88rem;
  font-weight: 600;
}

.home-tile svg {
  color: var(--accent-strong);
  opacity: 0.86;
}

.home-tile.wide {
  grid-column: 1 / -1;
  min-height: 76px;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.home-tile.live {
  background: rgba(157, 204, 255, 0.1);
}

.home-tile.is-disabled {
  border-color: rgba(209, 228, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
  color: rgba(226, 237, 250, 0.34);
  opacity: 0.72;
  filter: grayscale(0.7);
}

.home-tile.is-disabled svg {
  color: rgba(226, 237, 250, 0.34);
}

.home-tile.is-disabled span::after {
  content: " indispon\00edvel";
  display: block;
  margin-top: 4px;
  color: rgba(226, 237, 250, 0.26);
  font-size: 0.68rem;
  font-weight: 600;
}

.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: end center;
  padding: 18px;
  background: rgba(1, 4, 9, 0.68);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.legal-modal[hidden] {
  display: none;
}

.legal-dialog {
  position: relative;
  width: min(100%, 520px);
  max-height: min(76svh, 620px);
  overflow: auto;
  border-radius: 28px;
  padding: 24px;
  animation: rise 360ms ease both;
}

.legal-dialog h2 {
  margin: 0 44px 16px 0;
  font-size: 1.55rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.legal-dialog p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.65;
}

.legal-dialog p + p {
  margin-top: 14px;
}

.legal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(209, 228, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.legal-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.is-returning #setup-card {
  display: none;
}

.is-saved #setup-card {
  animation: saveFade 520ms ease both;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(0.85);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}

@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}

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

@keyframes saveFade {
  to {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
  }
}

@media (min-width: 720px) {
  body {
    display: grid;
    place-items: center;
  }

  .sie-shell {
    min-height: min(100svh, 980px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
