/* Wiply Account – styles (same look as the Wiply Assistant panel). Light and dark follow the device. */
:root {
  --bg: #f5f6fb;
  --surface: #ffffff;
  --border: #e3e5ef;
  --surface-2: #f0f1f8;
  --text: #171a2c;
  --muted: #646a85;
  --brand: #6a4cff;
  --brand-2: #22b8f0;
  --brand-soft: #efebff;
  --ok: #19a974;
  --ok-soft: #e3f7ee;
  --warn: #b26b00;
  --warn-soft: #fff3df;
  --danger: #d6455d;
  --danger-soft: #fde8ec;
  --radius: 14px;
  --sidebar: 248px;
  --shadow: 0 1px 2px rgba(20, 22, 50, 0.04), 0 8px 24px rgba(20, 22, 50, 0.06);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11121a;
    --surface: #1b1d29;
    --border: #2c2f42;
    --surface-2: #23263a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --text: #eceef7;
    --muted: #9da3bf;
    --brand: #8f7bff;
    --brand-soft: #262046;
    --ok-soft: #12352a;
    --warn-soft: #3a2a10;
    --danger-soft: #3d1a22;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a {
  color: var(--brand);
}

h1 {
  font-size: 26px;
  margin: 8px 0 18px;
}

h2 {
  font-size: 18px;
  margin: 0 0 12px;
}

h3 {
  font-size: 15px;
  margin: 18px 0 8px;
}

.shell {
  /* lo sfondo della barra laterale continua anche quando la pagina è più lunga dello schermo */
  background: linear-gradient(to right, var(--surface) calc(var(--sidebar) - 1px), var(--border) calc(var(--sidebar) - 1px), var(--border) var(--sidebar), var(--bg) var(--sidebar));
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 16px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(106, 76, 255, 0.35);
}

.big-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 8px;
  border-radius: 16px;
  font-size: 22px;
}

.brand-name {
  display: block;
  font-weight: 700;
}

.brand-sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

.nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav a[aria-current='page'] {
  background: var(--brand-soft);
  color: var(--brand);
}

.nav .count {
  margin-left: auto;
  min-width: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  text-align: center;
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 4px;
}

.sidebar-foot p {
  margin: 0;
  padding: 0 4px;
}

.me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: var(--surface-2);
}

.me-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.me-text > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  font-size: 14px;
}

.avatar.big {
  width: 64px;
  height: 64px;
  font-size: 22px;
}

.main {
  min-width: 0;
  max-width: 980px;
  padding: 32px 40px 56px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.page-head h1 {
  margin: 0;
  letter-spacing: -0.01em;
}

.page-head p {
  margin: 4px 0 0;
}

.bare-top {
  padding: 18px 24px;
}

.bare {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 0 0 24px;
}

.logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.logos li {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

.tile:hover,
.tile:focus-visible {
  border-color: var(--brand);
  transform: translateY(-1px);
}

.tile-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.tile-value {
  font-size: 28px;
  font-weight: 700;
}

.tile-hint {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.services {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.service {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.service-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.service-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 700;
}

.s-narendi {
  background: linear-gradient(135deg, #1f8f6a, #22b8a0);
}

.s-cassy {
  background: linear-gradient(135deg, #b44cff, #ff6fa8);
}

.s-studio {
  background: linear-gradient(135deg, #ff8a3d, #ffb84d);
}

.s-assistant {
  background: linear-gradient(135deg, #22b8f0, #6a4cff);
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.profile-head p {
  margin: 0;
}

.infos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 24px;
  margin: 0 0 12px;
}

.info dt {
  color: var(--muted);
  font-size: 13px;
}

.info dd {
  margin: 0;
  font-weight: 600;
}

.warn-card,
.warn-notice {
  background: var(--warn-soft);
  border-color: transparent;
}

.dialog {
  max-width: 440px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 22px;
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgba(10, 12, 30, 0.45);
}

.dialog p {
  margin: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.card.highlight {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.hero {
  text-align: center;
  padding: 48px 24px;
}

.hero .actions {
  justify-content: center;
}

.lead {
  font-size: 17px;
  color: var(--muted);
}

.big {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px;
}

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

.small {
  font-size: 13px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  margin: 2px 0 6px;
}

.error {
  color: var(--danger);
  font-size: 13px;
}

.notice {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--ok-soft);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.list li:last-child {
  border-bottom: 0;
}

.row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.grow {
  flex: 1 1 220px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

.field.check {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
  align-items: start;
}

.field.check label {
  margin: 0;
}

.field.check .hint {
  grid-column: 2;
}

.input,
.select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.input.short {
  max-width: 90px;
}

.select {
  width: auto;
}

.input:focus,
.select:focus,
.btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn.ghost {
  background: none;
  border-color: transparent;
}

.btn.danger-fill {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn.icon-only {
  padding: 6px;
}

.btn.danger {
  color: var(--danger);
}

.btn.small {
  padding: 5px 10px;
  font-size: 13px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
}

.badge.ok {
  background: var(--ok-soft);
  border-color: transparent;
  color: var(--ok);
}

.badge.warn {
  background: var(--warn-soft);
  border-color: transparent;
  color: var(--warn);
}

.badge.danger {
  background: var(--danger-soft);
  border-color: transparent;
  color: var(--danger);
}

details.create {
  margin-top: 16px;
}

details.create summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 12px;
}

.snippet {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.snippet code {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.stack .actions .input {
  flex: 1 1 200px;
  width: auto;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--text);
  color: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.toast.error {
  background: var(--danger);
  color: #fff;
}

.splash {
  display: grid;
  place-items: center;
  height: 60vh;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
  }

  .tile {
    transition: none;
  }

  .tile:hover {
    transform: none;
  }
}

@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
    background: var(--bg);
  }

  .sidebar {
    position: static;
    height: auto;
    gap: 12px;
    padding: 12px 16px;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .nav a {
    padding: 8px 10px;
  }

  .sidebar-foot p {
    display: none;
  }

  .main {
    padding: 16px;
  }
}

/* ---------- Logo di Wiply ---------- */

.brand-logo {
  display: block;
  height: 30px;
  width: auto;
}

.brand {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.hero-logo {
  display: block;
  height: 64px;
  width: auto;
  margin: 0 auto 18px;
}

.card-logo {
  display: block;
  height: 40px;
  width: auto;
  margin: 0 0 16px;
}

.bare {
  padding-top: 7vh;
}
