/* ==========================================================================
   Revo Suite — styles.css
   Palette brand, layout responsive, componenti riutilizzabili.
   ========================================================================== */

/* -------------------------------- Tokens --------------------------------- */
:root {
  /* Palette brand */
  --blue: #0360F2;
  --violet: #6449E4;
  --magenta: #DB30F3;
  --bg: #EBF2FA;
  --ink: #1B162B;
  --white: #FFFFFF;

  /* Derivati (tonalità e superfici) */
  --ink-70: rgba(27, 22, 43, 0.70);
  --ink-55: rgba(27, 22, 43, 0.55);
  --ink-40: rgba(27, 22, 43, 0.40);
  --border: rgba(27, 22, 43, 0.10);
  --border-strong: rgba(27, 22, 43, 0.16);

  /* Sfumatura brand, usata con moderazione */
  --grad: linear-gradient(120deg, var(--blue), var(--violet) 55%, var(--magenta));

  /* Ombre */
  --shadow-sm: 0 1px 2px rgba(27, 22, 43, 0.05);
  --shadow-md: 0 8px 24px rgba(27, 22, 43, 0.08);
  --shadow-lg: 0 16px 40px rgba(3, 96, 242, 0.14);

  --radius: 16px;
  --radius-sm: 10px;

  --maxw: 1200px;
}

/* -------------------------------- Reset ---------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }

button { font-family: inherit; }

a { color: inherit; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Focus visibile da tastiera, coerente su tutti gli elementi interattivi */
:focus-visible {
  outline: 3px solid rgba(3, 96, 242, 0.45);
  outline-offset: 2px;
  border-radius: 6px;
}

/* -------------------------------- Header --------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand__logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.brand__text { display: flex; flex-direction: column; line-height: 1.15; }

.brand__name {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.brand__tagline {
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-55);
}

.profile-placeholder {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink-55);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: not-allowed;
}

/* ---------------------------------- Hero --------------------------------- */
.hero {
  padding: 44px 0 28px;
}

.hero__eyebrow {
  margin: 0 0 10px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
}

.hero__title {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  max-width: 26ch;
}

/* Due righe controllate: la parte in gradiente inizia sempre su una nuova riga */
.hero__title-line { display: block; }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__subtitle {
  margin: 0;
  max-width: 56ch;
  font-size: 1.02rem;
  color: var(--ink-70);
}

/* -------------------------------- Controlli ------------------------------ */
.controls {
  position: sticky;
  top: 72px;
  z-index: 10;
  padding: 12px 0 18px;
  background: linear-gradient(var(--bg) 70%, rgba(235, 242, 250, 0));
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search__icon {
  position: absolute;
  left: 16px;
  color: var(--ink-40);
  pointer-events: none;
}

.search__input {
  width: 100%;
  padding: 14px 16px 14px 46px;
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search__input::placeholder { color: var(--ink-40); }

.search__input:hover { border-color: var(--border-strong); }

.search__input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(3, 96, 242, 0.12);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.filter {
  padding: 9px 16px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-70);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.filter:hover { border-color: var(--border-strong); color: var(--ink); }

.filter[aria-pressed="true"] {
  color: var(--white);
  background: var(--blue);
  border-color: var(--blue);
}

/* --------------------------------- Griglia ------------------------------- */
.apps { padding-bottom: 56px; }

.apps__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  gap: 18px;
}

.apps__empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--ink-55);
}

/* ---------------------------------- Card --------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(3, 96, 242, 0.35);
  box-shadow: var(--shadow-lg);
}

.card:focus-within {
  border-color: var(--blue);
}

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

.card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  color: var(--white);
  background: var(--grad);
  flex-shrink: 0;
}

/* Accento icona per categoria (moderato) */
.card[data-cat="Coaching"] .card__icon      { background: linear-gradient(135deg, var(--blue), var(--violet)); }
.card[data-cat="Analisi"] .card__icon       { background: linear-gradient(135deg, var(--violet), var(--magenta)); }
.card[data-cat="Amministrazione"] .card__icon { background: linear-gradient(135deg, #2a3a8f, var(--blue)); }
.card[data-cat="Commerciale"] .card__icon   { background: linear-gradient(135deg, var(--magenta), #8a2ad0); }
.card[data-cat="Risorse interne"] .card__icon { background: linear-gradient(135deg, var(--ink), var(--violet)); }

.card__icon svg { width: 24px; height: 24px; }

.badge {
  display: inline-block;
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  white-space: nowrap;
}

.badge--operativo {
  color: var(--blue);
  background: rgba(3, 96, 242, 0.10);
}

.badge--interno {
  color: var(--violet);
  background: rgba(100, 73, 228, 0.12);
}

.badge--neutro {
  color: var(--ink-55);
  background: rgba(27, 22, 43, 0.06);
}

.card__name {
  margin: 0 0 6px;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card__desc {
  margin: 0 0 18px;
  font-size: 0.92rem;
  color: var(--ink-70);
  /* Mantiene altezze equilibrate limitando la descrizione */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.card__cat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-55);
}

.card__cat::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

/* Pulsante apertura software */
.open-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--white);
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.open-btn:hover { background: #024fd0; transform: translateY(-1px); }

.open-btn svg { width: 15px; height: 15px; }

/* Stato disabilitato (URL da configurare) */
.open-btn--disabled {
  color: var(--ink-40);
  background: rgba(27, 22, 43, 0.05);
  border-color: var(--border);
  cursor: not-allowed;
  transform: none;
}

.open-btn--disabled:hover { background: rgba(27, 22, 43, 0.05); transform: none; }

/* -------------------------------- Footer --------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--white);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 22px;
  font-size: 0.86rem;
}

.footer__brand { font-weight: 600; }

.footer__meta { color: var(--ink-55); }

/* ------------------------------- Responsive ------------------------------ */
@media (max-width: 640px) {
  .container { padding-inline: 18px; }

  .brand__tagline { display: none; }

  .profile-placeholder span { display: none; }
  .profile-placeholder { padding: 9px; }

  .hero { padding: 32px 0 22px; }

  /* Su mobile i controlli non restano sticky, per non rubare spazio */
  .controls { position: static; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* Rispetta le preferenze di riduzione del movimento */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
