:root {
  --paper: #F0F2F5;
  --ink: #111A21;
  --muted: #66727A;
  --line: #D7DDE1;
  --whatsapp: #25D366;
  --neon: #39FF14;
  --drawer: #111A21;
  --shadow: 0 26px 70px rgba(17, 26, 33, 0.28);
}

* { box-sizing: border-box; }

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

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, a { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; position: relative; overflow: hidden; }

.topbar {
  height: 68px;
  padding: 0 clamp(6px, 1vw, 16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--paper);
  background: #1D303A;
  border-bottom: 3px solid var(--whatsapp);
  box-shadow: 0 10px 28px rgba(17, 26, 33, .3);
  position: relative;
  z-index: 4;
}

.topbar-left { display: flex; align-items: center; gap: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: "Space Grotesk", sans-serif; font-size: 17px; font-weight: 600; letter-spacing: 0.01em; }
.company-logo { width: 38px; height: 38px; display: block; border: 2px solid var(--whatsapp); border-radius: 9px; object-fit: contain; image-rendering: auto; }
.menu-button { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 0; color: inherit; background: transparent; transition: color .2s ease; }
.menu-button:hover, .menu-button:focus-visible { color: inherit; }
.menu-icon { width: 21px; height: 17px; display: flex; flex-direction: column; justify-content: space-between; }
.menu-icon span { width: 100%; height: 2px; display: block; background: currentColor; transition: transform .25s ease; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.notification-button, .profile-button { position: relative; display: grid; place-items: center; padding: 0; border: 0; color: inherit; background: transparent; cursor: pointer; }
.notification-button { width: 34px; height: 34px; }
.bell-icon { display: block; font-size: 18px; line-height: 1; filter: grayscale(1) brightness(0) invert(1); transition: transform .2s ease, filter .2s ease; }
.notification-button:hover .bell-icon, .notification-button:focus-visible .bell-icon { transform: translateY(-2px); filter: none; }
.notification-dot { width: 7px; height: 7px; position: absolute; top: 3px; right: 3px; border: 1px solid var(--ink); border-radius: 50%; background: var(--neon); box-shadow: 0 0 8px rgba(57, 255, 20, .8); }
.profile-button { width: 38px; height: 38px; border-radius: 50%; }
.profile-image { width: 38px; height: 38px; display: block; border: 2px solid var(--whatsapp); border-radius: 50%; object-fit: cover; transition: border-color .2s ease, transform .2s ease; }
.profile-button:hover .profile-image, .profile-button:focus-visible .profile-image { border-color: var(--neon); transform: scale(1.05); }

.main-content { max-width: 1180px; margin: 0 auto; padding: clamp(56px, 8vh, 92px) clamp(24px, 8vw, 120px) 100px; }
.connection-page { width: 100%; max-width: 980px; }
.page-heading { max-width: 620px; }
.page-heading h1 { font-size: clamp(42px, 6vw, 72px); }
.page-description { max-width: 440px; margin: 20px 0 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
.connection-grid { display: grid; grid-template-columns: minmax(0, 760px); gap: 18px; margin-top: 42px; }
.connection-card { min-height: 390px; padding: 34px; display: flex; flex-direction: column; border: 1px solid var(--line); background: #FFFFFF; transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.connection-card--whatsapp { background: linear-gradient(135deg, #FFFFFF 0%, #F7FCF9 100%); }
.connection-card:hover { border-color: #A8B5BC; box-shadow: 0 14px 32px rgba(17, 26, 33, .08); transform: translateY(-2px); }
.connection-card--invalid { border-color: #E07A73; }
.connection-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.service-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--paper); font-family: "Space Grotesk", sans-serif; font-size: 19px; font-weight: 700; }
.service-icon--whatsapp { background: var(--whatsapp); color: var(--ink); }
.service-icon--evolution { background: var(--neon); color: var(--ink); }
.connection-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 600; }
.status-indicator { width: 7px; height: 7px; border-radius: 50%; background: #AAB5BC; }
.status-indicator--ready { background: var(--neon); box-shadow: 0 0 8px rgba(57, 255, 20, .75); }
.connection-card-title { margin: 30px 0 26px; }
.connection-card-title h2 { margin: 0 0 8px; font-family: "Space Grotesk", sans-serif; font-size: 25px; letter-spacing: -.03em; }
.connection-card-title p { max-width: 470px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.connection-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 28px; }
.connection-step { min-height: 72px; padding: 12px; border-left: 2px solid var(--whatsapp); background: rgba(37, 211, 102, .08); }
.connection-step span { color: #168A45; font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.connection-step p { margin: 8px 0 0; color: #53616A; font-size: 11px; line-height: 1.35; }
.automatic-instance-note { margin-top: auto; padding: 13px 14px; color: #168A45; background: rgba(37, 211, 102, .1); font-size: 12px; font-weight: 600; }
.field-label { margin: 0 0 7px; color: #53616A; font-size: 11px; font-weight: 700; }
.field-input { width: 100%; height: 42px; margin-bottom: 16px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; outline: none; color: var(--ink); background: #FAFBFC; font-size: 13px; }
.field-input:focus { border-color: var(--whatsapp); box-shadow: 0 0 0 3px rgba(37, 211, 102, .14); }
.field-input::placeholder { color: #9BA6AC; }
.connection-action { min-height: 48px; margin-top: auto; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 6px; color: var(--ink); background: var(--whatsapp); font-size: 13px; font-weight: 700; transition: background-color .2s ease, transform .2s ease; }
.connection-action:hover { background: var(--neon); transform: translateY(-1px); }
.connection-action:disabled { cursor: wait; opacity: .7; transform: none; }
.connection-action--disconnect { color: #FFFFFF; background: #C94B52; }
.connection-action--disconnect:hover { background: #A83B42; }
.button-mark { font-size: 21px; font-weight: 400; line-height: 1; }
.qr-result { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; }
.qr-result p { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.qr-result .qr-title { color: var(--ink); font-weight: 700; }
.qr-result .qr-expiry { margin: 12px 0 0; color: #8A969E; font-size: 11px; }
.qr-result img { width: 190px; height: 190px; display: inline-block; padding: 10px; border: 1px solid var(--line); background: #FFFFFF; object-fit: contain; }
.connection-note { display: flex; align-items: center; gap: 10px; margin-top: 24px; color: var(--muted); font-size: 12px; }
.note-mark { width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid #93A0A7; border-radius: 50%; font-size: 11px; font-weight: 700; }
.intro { max-width: 690px; }
.eyebrow { margin: 0 0 22px; color: #168A45; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
h1 { max-width: 620px; margin: 0; font-family: "Space Grotesk", sans-serif; font-size: clamp(48px, 7.2vw, 92px); line-height: .98; letter-spacing: -.055em; font-weight: 600; }
.intro-copy { max-width: 390px; margin: 30px 0 0; color: var(--muted); font-size: 17px; line-height: 1.55; }

.overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 780px; margin-top: clamp(72px, 12vh, 140px); }
.overview-card { min-height: 220px; padding: 27px 28px 24px; display: flex; flex-direction: column; border: 1px solid var(--line); background: #FFFFFF; }
.overview-card--accent { color: var(--ink); border-color: var(--whatsapp); background: rgba(37, 211, 102, .16); }
.card-heading, .card-footer { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.card-heading { color: #53616A; font-weight: 600; }
.overview-card--accent .card-heading { color: #168A45; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--neon); box-shadow: 0 0 10px rgba(57, 255, 20, .72); }
.card-number { color: #8A969E; font-family: "Space Grotesk", sans-serif; }
.overview-card strong { margin: auto 0; font-family: "Space Grotesk", sans-serif; font-size: clamp(24px, 3vw, 36px); letter-spacing: -.04em; font-weight: 600; }
.card-footer { color: #66727A; }
.overview-card--accent .card-footer { color: #168A45; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 3; background: rgba(17, 26, 33, .58); opacity: 0; pointer-events: none; transition: opacity .45s ease; }
.drawer { width: min(320px, calc(100vw - 24px)); min-height: 100vh; padding: 0; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; z-index: 6; background: var(--drawer); box-shadow: var(--shadow); transform: translateX(-105%); transition: transform .95s cubic-bezier(.16, .84, .24, 1); will-change: transform; touch-action: pan-y; }
.drawer.is-dragging { transition: none; user-select: none; }
body.drawer-open .drawer { transform: translateX(0); }
body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer-header, .drawer-nav, .drawer-footer { opacity: 0; transform: translateX(-12px); transition: opacity .4s ease, transform .5s cubic-bezier(.22, .9, .3, 1); }
body.drawer-open .drawer-header { opacity: 1; transform: translateX(0); transition-delay: .1s; }
body.drawer-open .drawer-nav { opacity: 1; transform: translateX(0); transition-delay: .16s; }
body.drawer-open .drawer-footer { opacity: 1; transform: translateX(0); transition-delay: .24s; }
.drawer-brand { width: 100%; display: flex; justify-content: flex-start; padding: 0; background: #075E54; opacity: 0; transform: translateX(-12px); transition: opacity .4s ease, transform .5s cubic-bezier(.22, .9, .3, 1); }
body.drawer-open .drawer-brand { opacity: 1; transform: translateX(0); transition-delay: .08s; }
.drawer-logo { width: 100%; height: 190px; max-height: 260px; margin-left: 0; display: block; border: 0; border-radius: 0; object-fit: fill; background: transparent; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 34px; border-bottom: 1px solid rgba(240, 242, 245, .2); }
.drawer-title { color: #AAB5BC; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; padding: 0 0 3px; border: 1px solid rgba(240, 242, 245, .35); border-radius: 50%; color: var(--paper); background: transparent; font-size: 25px; font-weight: 300; line-height: 1; transition: border-color .2s ease, color .2s ease; }
.icon-button:hover, .icon-button:focus-visible { color: var(--whatsapp); border-color: var(--whatsapp); }
.drawer-nav { margin: 0; padding: 20px 24px 22px; background: var(--drawer); }
.drawer-section-title { margin: 0 0 12px; color: #6F7C85; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.drawer-link { display: flex; align-items: center; padding: 15px 0; color: var(--paper); border: 0; border-radius: 0; background: transparent; font-size: 19px; font-weight: 600; transition: color .2s ease, transform .2s ease; }
.drawer-link:hover, .drawer-link--active { color: var(--paper); background: transparent; transform: translateX(0); }
.link-index { width: 22px; color: #6F7C85; font-size: 10px; font-weight: 700; }
.drawer-footer { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 22px; border-top: 1px solid rgba(240, 242, 245, .2); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--whatsapp); font-size: 10px; font-weight: 700; }
.drawer-footer div { display: flex; flex-direction: column; gap: 2px; }
.drawer-footer strong { font-size: 13px; }
.drawer-footer span:not(.avatar) { color: #AAB5BC; font-size: 11px; }

@media (max-width: 600px) {
  .topbar { height: 60px; }
  .main-content { padding-top: 60px; }
  .connection-grid { grid-template-columns: 1fr; margin-top: 48px; }
  .connection-card { min-height: 360px; padding: 22px; }
  .connection-steps { grid-template-columns: 1fr; gap: 7px; }
  .connection-step { min-height: auto; padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
  .connection-step p { margin: 0; }
  .overview { grid-template-columns: 1fr; margin-top: 64px; }
  .overview-card { min-height: 188px; }
  h1 { font-size: clamp(46px, 15vw, 72px); }
}

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