/* Schneider App Hub — launcher adaptativo, carga leve */
:root {
  --brand-dark: #326f75;
  --brand-mid: #3e8992;
  --brand-light: #9eb9be;
  --ink: #1a2c2e;
  --muted: #5f7376;
  --paper: #eef5f4;
  --surface: #ffffff;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif;
  --sign: "Great Vibes", "Snell Roundhand", "Segoe Script", Palatino, Georgia, serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  height: 100svh;
  height: 100dvh;
  min-height: 100%;
  min-height: -webkit-fill-available;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
}

body {
  overflow-x: hidden;
}

body:has(#hub-cards:not([hidden])) {
  overflow: hidden;
}

.hub-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(90% 50% at 50% -8%, rgba(62, 137, 146, 0.16), transparent 58%),
    linear-gradient(180deg, #f7fbfb 0%, #eef5f4 42%, #e6f0ef 100%);
  pointer-events: none;
}

.hub {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  min-height: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  height: 100%;
  height: 100svh;
  height: 100dvh;
  padding: calc(0.4rem + var(--safe-t)) calc(0.85rem + var(--safe-r)) calc(0.55rem + var(--safe-b)) calc(0.85rem + var(--safe-l));
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.hub-head {
  display: grid;
  justify-items: center;
  flex: 0 0 auto;
  width: 100%;
  padding-top: 0.15rem;
  padding-bottom: 0.2rem;
  order: 0;
}

.hub-logo {
  width: auto;
  max-width: min(16.5rem, 78vw);
  max-height: min(5.8rem, 16vh);
  height: auto;
  display: block;
  object-fit: contain;
  background: transparent;
  -webkit-user-drag: none;
}

.hub-login-err {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #8a2f2f;
  text-align: center;
}

.hub-login-err[hidden] {
  display: none !important;
}

.hub-doors {
  width: 100%;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.hub-doors[hidden] {
  display: none !important;
}

.hub-door {
  appearance: none;
  border: 1.5px solid rgba(50, 111, 117, 0.28);
  background: #fff;
  border-radius: 16px;
  min-height: 52px;
  padding: 0.5rem 0.7rem;
  text-align: left;
  cursor: pointer;
  font: inherit;
  touch-action: manipulation;
}

.hub-door strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.hub-door small {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
}

.hub-doors-need {
  outline: 2px solid var(--brand-mid);
  outline-offset: 3px;
  border-radius: 16px;
}

.hub-login-lead {
  margin: 0 0 0.15rem;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
}

.hub-login {
  width: 100%;
  display: grid;
  gap: 0.4rem;
  order: 2;
}

.hub-login:not([hidden]) {
  flex: 1;
  align-content: center;
}

.hub-login[hidden] {
  display: none !important;
}

.hub-login label {
  display: grid;
  gap: 0.18rem;
}

.hub-login span {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
}

.hub-login input {
  appearance: none;
  width: 100%;
  border: 1.5px solid rgba(50, 111, 117, 0.28);
  background: #fff;
  border-radius: 14px;
  min-height: 44px;
  padding: 0.45rem 0.75rem;
  font: inherit;
  font-size: 0.92rem;
  color: var(--ink);
}

.hub-pass-wrap {
  position: relative;
  display: block;
}

.hub-pass-wrap input {
  padding-right: 2.85rem;
}

.hub-pass-eye {
  appearance: none;
  position: absolute;
  right: 0.28rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: manipulation;
}

.hub-pass-eye:hover,
.hub-pass-eye:focus-visible {
  color: var(--brand-dark);
  outline: none;
}

.hub-pass-eye:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-mid) 55%, transparent);
}

.hub-pass-eye .hub-eye-off {
  display: none;
}

.hub-pass-eye.is-on .hub-eye-on {
  display: none;
}

.hub-pass-eye.is-on .hub-eye-off {
  display: block;
}

.hub-login input:focus {
  outline: 2px solid var(--brand-mid);
  outline-offset: 1px;
}

.hub-login-go {
  appearance: none;
  border: 1px solid #2c6368;
  background: var(--brand-dark);
  color: #fff;
  border-radius: 14px;
  min-height: 44px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset, 0 2px 8px rgba(50, 111, 117, 0.2);
}

.hub-cards {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  gap: clamp(0.55rem, 1.8vh, 1.05rem);
  align-content: stretch;
  order: 2;
}

.hub-cards[hidden] {
  display: none !important;
}

.hub-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(0.85rem, 2.4vw, 1.4rem);
  min-height: 0;
  height: 100%;
  width: 100%;
  padding: clamp(0.85rem, 2.2vh, 1.6rem) clamp(1rem, 3vw, 1.6rem);
  border-radius: clamp(18px, 3.4vw, 28px);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 28px rgba(26, 44, 46, 0.16);
  transition: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.hub-card:active {
  transform: none;
}

.hub-card-ico {
  flex-shrink: 0;
  width: clamp(2.5rem, 6.5vw, 3.6rem);
  height: clamp(2.5rem, 6.5vw, 3.6rem);
  display: grid;
  place-items: center;
  border-radius: 22%;
  overflow: hidden;
  background: transparent;
  box-shadow: 0 4px 12px rgba(24, 72, 78, 0.22);
}

.hub-card-ico svg {
  display: block;
}

.hub-card-crm .hub-card-ico,
.hub-card-agenda .hub-card-ico,
.hub-card-chat .hub-card-ico {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: none;
  color: #fff;
  border-radius: 16px;
}

.hub-hex {
  width: 1.85rem;
  height: 1.85rem;
  display: block;
}

.hub-card-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  z-index: 1;
}

.hub-card-copy em,
.hub-card-copy small {
  display: block;
  margin-top: 0.18rem;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  opacity: 0.78;
}

.hub-card-copy strong {
  font-size: clamp(1.2rem, 3.4vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.1;
}

.hub-card-crm {
  background: linear-gradient(135deg, #326f75 0%, #3e8992 55%, #2a5a5f 100%);
  color: #fff;
  box-shadow: 0 14px 36px rgba(50, 111, 117, 0.32);
}

.hub-card-agenda {
  background: linear-gradient(135deg, #245054 0%, #326f75 52%, #3e8992 100%);
  color: #fff;
  box-shadow: 0 12px 32px rgba(36, 80, 84, 0.28);
}

.hub-card-chat {
  background: linear-gradient(135deg, #1f5c63 0%, #326f75 50%, #245054 100%);
  color: #fff;
  box-shadow: 0 12px 32px rgba(31, 92, 99, 0.3);
}

.hub-update {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 1.5rem;
  background: #eef5f4;
  text-align: center;
}

.hub-update[hidden] {
  display: none !important;
}

body.app-update-open {
  overflow: hidden;
}

.hub-pwa {
  position: fixed;
  z-index: 8;
  left: 50%;
  bottom: calc(5.75rem + var(--safe-b));
  transform: translateX(-50%);
  width: min(22rem, calc(100% - 1.6rem));
  padding: 0.85rem 1rem;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(50, 111, 117, 0.18);
  box-shadow: 0 16px 40px rgba(26, 44, 46, 0.16);
  text-align: center;
}

.hub-pwa[hidden] {
  display: none !important;
}

.hub-pwa-title {
  margin: 0 0 0.35rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.hub-pwa-copy {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

.hub-pwa-ok {
  appearance: none;
  border: 0;
  min-height: 42px;
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  background: var(--brand-dark);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.hub-foot {
  display: grid;
  justify-items: center;
  flex: 0 0 auto;
  order: 3;
  padding-top: 0.12rem;
}

.hub-sign {
  width: min(4.35rem, 24vw);
  height: auto;
  display: block;
  object-fit: contain;
  opacity: 0.72;
  -webkit-user-drag: none;
}

@media (hover: hover) and (pointer: fine) {
  .hub-card:hover {
    transform: none;
  }
}

@media (max-height: 700px) {
  .hub-logo {
    max-width: min(13.5rem, 70vw);
    max-height: min(4.8rem, 14vh);
  }

  .hub-sign {
    width: min(3.6rem, 20vw);
  }

  .hub-head {
    padding-bottom: 0.05rem;
  }

  .hub {
    gap: 0.4rem;
  }
}

@media (max-width: 380px) {
  .hub {
    padding-left: calc(0.7rem + var(--safe-l));
    padding-right: calc(0.7rem + var(--safe-r));
  }

  .hub-card-copy strong {
    letter-spacing: 0.04em;
  }
}

/* Paisagem no telefone: logo compacta, 3 botões lado a lado preenchendo a altura */
@media (orientation: landscape) and (max-height: 520px) {
  .hub {
    width: 100%;
    padding: calc(0.28rem + var(--safe-t)) calc(0.7rem + var(--safe-r)) calc(0.32rem + var(--safe-b)) calc(0.7rem + var(--safe-l));
    gap: 0.35rem;
  }

  .hub-logo {
    max-width: min(11rem, 28vw);
    max-height: 3.4rem;
  }

  .hub-sign {
    width: 3.1rem;
  }

  .hub-cards {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: minmax(0, 1fr);
    min-height: 0;
    gap: 0.55rem;
  }

  .hub-card {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 0.7rem 0.55rem;
  }

  .hub-card-copy strong {
    font-size: clamp(0.92rem, 2.6vw, 1.15rem);
  }
}

/* Tablet: ainda empilhado, quase a tela inteira */
@media (min-width: 720px) {
  .hub {
    width: 100%;
    padding: calc(0.55rem + var(--safe-t)) calc(1.25rem + var(--safe-r)) calc(0.7rem + var(--safe-b)) calc(1.25rem + var(--safe-l));
    gap: 0.7rem;
  }

  .hub-logo {
    max-width: min(17rem, 42vw);
    max-height: 6.2rem;
  }

  .hub-sign {
    width: 4.8rem;
  }

  .hub-card-copy strong {
    font-size: clamp(1.45rem, 2.6vw, 1.85rem);
  }

  .hub-card-copy small {
    font-size: 0.9rem;
  }
}

/* PC: os três botões ocupam a largura útil e a altura que sobra da logo */
@media (min-width: 980px) {
  .hub {
    width: calc(100% - 2rem);
    max-width: none;
    padding: calc(0.7rem + var(--safe-t)) 1.15rem calc(0.9rem + var(--safe-b));
    gap: 0.85rem;
  }

  .hub-logo {
    max-width: 18rem;
    max-height: 6.6rem;
  }

  .hub-sign {
    width: 5.1rem;
  }

  .hub-cards {
    gap: 1rem;
  }

  .hub-card {
    border-radius: 28px;
    padding-left: 1.7rem;
  }
}

@media (min-width: 1280px) {
  .hub-bg {
    background:
      radial-gradient(42% 38% at 50% 0%, rgba(62, 137, 146, 0.16), transparent 62%),
      #f4f8f7;
  }

  .hub-card-ico {
    width: 3.6rem;
    height: 3.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-card {
    transition: none;
  }

  .hub-card:active,
  .hub-card:hover {
    transform: none;
  }
}

@media (prefers-color-scheme: dark) {
  /* Hub da equipe permanece claro: lockup e assinatura leem no papel da marca. */
}

/* ============================================================
   Visual Apple (mesmo padrão do painel): leve, sutil, moderno.
   ============================================================ */
html body {
  --ap-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", system-ui, sans-serif;
  font-family: var(--ap-font);
  color: #1d1d1f;
  background: #f5f5f7;
  letter-spacing: -0.01em;
}
html body .hub-bg {
  background: #f5f5f7;
}

/* Login: cartão branco centralizado */
html body .hub-login {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  gap: 12px;
}
html body .hub-login:not([hidden]) {
  flex: 0 1 auto;
  margin-top: auto;
  margin-bottom: auto;
  padding: 28px 24px 24px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}
html body .hub-login-lead {
  font-size: 15px;
  line-height: 1.45;
  color: #6e6e73;
  margin-bottom: 6px;
}
html body .hub-login label > span:first-child {
  font-size: 13px;
  font-weight: 500;
  color: #6e6e73;
  padding-left: 4px;
}
html body .hub-login input {
  border: 0;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  min-height: 48px;
  font-family: var(--ap-font);
  font-size: 16px;
  color: #1d1d1f;
  box-shadow: none;
  transition: box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
html body .hub-login input:focus {
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(50, 111, 117, 0.15), inset 0 0 0 1px #326f75;
}
html body .hub-login-go {
  border: 0;
  border-radius: 980px;
  min-height: 48px;
  margin-top: 6px;
  background: #326f75;
  box-shadow: none;
  font-family: var(--ap-font);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease);
}
html body .hub-login-go:hover {
  background: #3e8992;
}
html body .hub-login-go:active {
  transform: scale(0.98);
}
html body .hub-login-err {
  color: #c45c4a;
  font-weight: 500;
}

/* Depois do login: três cartões grandes, cor sólida da marca, sem brilho */
html body .hub-card {
  border: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
html body .hub-card-crm,
html body .hub-card-agenda,
html body .hub-card-chat {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
html body .hub-card-crm { background: #326f75; }
html body .hub-card-agenda { background: #2c6368; }
html body .hub-card-chat { background: #245054; }
html body .hub-card-copy strong {
  font-family: var(--ap-font);
  font-weight: 700;
  letter-spacing: -0.025em;
}
html body .hub-card-copy small {
  opacity: 0.8;
  font-weight: 500;
}
html body .hub-card-ico {
  background: rgba(255, 255, 255, 0.14) !important;
  box-shadow: none !important;
}
@media (hover: hover) and (pointer: fine) {
  html body .hub-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  }
}

/* Avisos (instalar / atualizar) */
html body .hub-pwa {
  border: 0;
  border-radius: 22px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
html body .hub-pwa-ok {
  border-radius: 980px;
  background: #326f75;
}
html body .hub-card-copy strong {
  text-transform: none;
}
html body .hub-card-copy small {
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
}
html body .hub-login input:-webkit-autofill,
html body .hub-login input:-webkit-autofill:hover,
html body .hub-login input:-webkit-autofill:focus {
  -webkit-text-fill-color: #1d1d1f;
  -webkit-box-shadow: 0 0 0 1000px #efeff1 inset;
  caret-color: #1d1d1f;
}
