:root {
  color-scheme: dark;
  --background: #070b16;
  --background-2: #0b1020;
  --panel: rgba(17, 24, 39, 0.86);
  --panel-strong: rgba(21, 31, 49, 0.94);
  --text: #f9fafb;
  --muted: #9ca3af;
  --accent: #38bdf8;
  --online: #22c55e;
  --preparing: #f59e0b;
  --maintenance: #f97316;
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(56, 189, 248, 0.2), transparent 30rem),
    radial-gradient(circle at 88% 18%, rgba(34, 197, 94, 0.11), transparent 26rem),
    linear-gradient(145deg, var(--background) 0%, var(--background-2) 48%, #08111d 100%);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.login-shell,
.placeholder-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel,
.placeholder-panel {
  width: min(100%, 440px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(17, 24, 39, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.placeholder-panel {
  display: grid;
  gap: 28px;
  text-align: center;
}

.hub-shell {
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.hub-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0 24px;
}

.hub-header::before {
  content: "";
  position: absolute;
  inset: -80px auto auto -120px;
  width: 340px;
  height: 220px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.18), transparent 68%);
  filter: blur(6px);
}

.brand-lockup {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-lockup.centered {
  justify-content: center;
}

.brand-mark {
  width: 58px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(56, 189, 248, 0.36);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(56, 189, 248, 0.22), rgba(52, 211, 153, 0.1)),
    rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 900;
  box-shadow: 0 18px 46px rgba(56, 189, 248, 0.12);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 1.02;
}

.hub-header h1,
.login-panel h1 {
  font-size: clamp(1.8rem, 7vw, 2.55rem);
}

.header-subtitle {
  max-width: 560px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 2vw, 1.08rem);
  line-height: 1.45;
}

.intro {
  padding: 8px 0 28px;
}

.intro p {
  margin: 0;
  color: #d1d5db;
  font-size: clamp(1.04rem, 3vw, 1.28rem);
  line-height: 1.5;
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

input {
  min-height: 48px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  outline: none;
}

input:focus {
  border-color: rgba(56, 189, 248, 0.75);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

.primary-button,
.ghost-button,
.open-link {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 0 18px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.primary-button,
.open-link {
  color: #03111c;
  background: linear-gradient(135deg, var(--card-accent, var(--accent)), #e0f2fe);
  box-shadow: 0 14px 32px rgba(56, 189, 248, 0.16);
}

.primary-button:hover,
.open-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(56, 189, 248, 0.2);
}

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

.ghost-button:hover {
  border-color: rgba(56, 189, 248, 0.34);
  background: rgba(255, 255, 255, 0.08);
}

.form-error {
  margin: -4px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: 12px;
  color: #fecaca;
  background: rgba(127, 29, 29, 0.22);
}

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

.app-card {
  --card-accent: #38bdf8;
  position: relative;
  min-height: 278px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 46%),
    var(--panel);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.24);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.app-card::before {
  content: "";
  position: absolute;
  inset: -90px -90px auto auto;
  width: 190px;
  height: 190px;
  pointer-events: none;
  background: radial-gradient(circle, var(--card-accent-glow, rgba(56, 189, 248, 0.24)), transparent 66%);
  opacity: 0.86;
}

.app-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-accent-border, rgba(56, 189, 248, 0.38));
  background:
    linear-gradient(180deg, var(--card-accent-wash, rgba(56, 189, 248, 0.08)), transparent 55%),
    var(--panel-strong);
  box-shadow: 0 24px 68px rgba(0, 0, 0, 0.3);
}

.app-card-muted {
  opacity: 0.82;
}

.app-card-muted .open-link {
  color: var(--text);
  border: 1px solid var(--card-accent-border, rgba(255, 255, 255, 0.12));
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}

.app-card-sky {
  --card-accent: #38bdf8;
  --card-accent-glow: rgba(56, 189, 248, 0.24);
  --card-accent-wash: rgba(56, 189, 248, 0.08);
  --card-accent-border: rgba(56, 189, 248, 0.4);
}

.app-card-gold {
  --card-accent: #fbbf24;
  --card-accent-glow: rgba(251, 191, 36, 0.2);
  --card-accent-wash: rgba(251, 191, 36, 0.07);
  --card-accent-border: rgba(251, 191, 36, 0.34);
}

.app-card-aqua {
  --card-accent: #2dd4bf;
  --card-accent-glow: rgba(45, 212, 191, 0.2);
  --card-accent-wash: rgba(45, 212, 191, 0.07);
  --card-accent-border: rgba(45, 212, 191, 0.34);
}

.app-card-violet {
  --card-accent: #a78bfa;
  --card-accent-glow: rgba(167, 139, 250, 0.2);
  --card-accent-wash: rgba(167, 139, 250, 0.07);
  --card-accent-border: rgba(167, 139, 250, 0.34);
}

.app-card-blue {
  --card-accent: #60a5fa;
  --card-accent-glow: rgba(96, 165, 250, 0.2);
  --card-accent-wash: rgba(96, 165, 250, 0.07);
  --card-accent-border: rgba(96, 165, 250, 0.34);
}

.app-card-silver {
  --card-accent: #94a3b8;
  --card-accent-glow: rgba(148, 163, 184, 0.16);
  --card-accent-wash: rgba(148, 163, 184, 0.06);
  --card-accent-border: rgba(148, 163, 184, 0.32);
}

.card-topline,
.card-copy,
.open-link {
  position: relative;
}

.card-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.status-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.76rem;
  font-weight: 850;
}

.status-online {
  border-color: rgba(34, 197, 94, 0.3);
  color: #bbf7d0;
  background: rgba(20, 83, 45, 0.34);
}

.status-in-preparazione {
  border-color: rgba(245, 158, 11, 0.3);
  color: #fde68a;
  background: rgba(120, 53, 15, 0.25);
}

.status-manutenzione {
  border-color: rgba(249, 115, 22, 0.34);
  color: #fed7aa;
  background: rgba(124, 45, 18, 0.28);
}

.card-copy h2 {
  margin-bottom: 10px;
  font-size: clamp(1.24rem, 2vw, 1.48rem);
  line-height: 1.15;
}

.card-copy p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.52;
}

.app-icon {
  width: 58px;
  aspect-ratio: 1;
  border: 1px solid var(--card-accent-border, rgba(255, 255, 255, 0.08));
  border-radius: 16px;
  background-color: rgba(255, 255, 255, 0.045);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 30px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
}

.app-icon-home {
  background-image: url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 24 24' fill='none' stroke='%2338BDF8' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m3 11 9-8 9 8'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3Cpath d='M9 20v-6h6v6'/%3E%3Cpath d='M16.5 6.5v2.2'/%3E%3C/svg%3E");
}

.app-icon-coin {
  background-image: url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 24 24' fill='none' stroke='%23FBBF24' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Cpath d='M12 7v10M15 9.5A3 3 0 0 0 12.5 8H11a2 2 0 0 0 0 4h2a2 2 0 0 1 0 4h-1.5A3 3 0 0 1 9 14.5'/%3E%3C/svg%3E");
}

.app-icon-taxi {
  background-image: url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 24 24' fill='none' stroke='%232DD4BF' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 17h14l-1.4-6.3A3 3 0 0 0 14.7 8H9.3a3 3 0 0 0-2.9 2.7L5 17Z'/%3E%3Cpath d='M7 17v2M17 17v2M8 13h8M9 8l1-3h4l1 3'/%3E%3C/svg%3E");
}

.app-icon-store {
  background-image: url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 24 24' fill='none' stroke='%23A78BFA' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 10h16l-1-5H5l-1 5Z'/%3E%3Cpath d='M5 10v9h14v-9M9 19v-5h6v5'/%3E%3Cpath d='M8 10v1.5M12 10v1.5M16 10v1.5'/%3E%3C/svg%3E");
}

.app-icon-lab {
  background-image: url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 24 24' fill='none' stroke='%2360A5FA' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 3v5l-5 9a3 3 0 0 0 2.6 4.5h8.8A3 3 0 0 0 19 17l-5-9V3'/%3E%3Cpath d='M8 3h8M8 15h8'/%3E%3Cpath d='m16 5 1-2 1 2 2 1-2 1-1 2-1-2-2-1 2-1Z'/%3E%3C/svg%3E");
}

.app-icon-settings {
  background-image: url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22s7-3.5 7-10V5l-7-3-7 3v7c0 6.5 7 10 7 10Z'/%3E%3Ccircle cx='12' cy='11' r='2.5'/%3E%3Cpath d='M12 7.5V6M12 16v-1.5M15.1 8.9l1.1-1.1M7.8 16.2l1.1-1.1M15.1 15.1l1.1 1.1M7.8 7.8l1.1 1.1'/%3E%3C/svg%3E");
}

.hub-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 28px 0 10px;
  color: rgba(249, 250, 251, 0.52);
  font-size: 0.86rem;
}

@media (max-width: 980px) {
  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .hub-shell {
    padding: 18px;
  }

  .hub-header {
    align-items: stretch;
    flex-direction: column;
    padding-top: 10px;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .brand-mark {
    width: 52px;
    border-radius: 14px;
  }

  .hub-header .ghost-button {
    width: 100%;
  }

  .intro {
    padding-bottom: 20px;
  }

  .app-grid {
    grid-template-columns: 1fr;
  }

  .app-card {
    min-height: 244px;
    padding: 22px;
  }

  .open-link {
    width: 100%;
  }

  .login-panel,
  .placeholder-panel {
    padding: 22px;
  }

  .hub-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
