/* ══════════════════════════════════════════════════════════════
   Vorqen Login — CSS
   Design tokens + base typography + page kit (split layout:
   form left, product preview right).
   ══════════════════════════════════════════════════════════════ */

/* ── Fonts (self-hosted; no external CDN) ── */
@font-face {
  font-family: "Manrope";
  src: url("./fonts/Manrope-Variable.ttf") format("truetype-variations"),
       url("./fonts/Manrope-Variable.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("./fonts/PlusJakartaSans-Variable.ttf") format("truetype-variations"),
       url("./fonts/PlusJakartaSans-Variable.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #edf3f9;
  --bg-strong: #0f1a27;
  --surface: #ffffff;
  --surface-soft: #f6f9fc;
  --surface-muted: #eef3f8;

  --line: #d7e1ec;
  --line-strong: #bed0e2;

  --text: #102132;
  --muted: #64748b;
  --navy-muted: rgba(15, 26, 39, 0.6);

  --accent: #1f7aec;
  --accent-strong: #175dbb;
  --accent-brand: #58a7ff;
  --accent-soft: rgba(31, 122, 236, 0.10);

  --mint: #84e1cb;

  --success: #109b6d;
  --success-soft: rgba(16, 155, 109, 0.10);
  --warning: #b67823;
  --warning-soft: rgba(182, 120, 35, 0.10);
  --danger:  #d34a4a;
  --danger-soft:  rgba(211, 74, 74, 0.10);

  --sidebar-gradient: linear-gradient(180deg, #0c1520 0%, #162234 60%, #1a2b40 100%);

  --page-bg:
    radial-gradient(circle at top right, rgba(31, 122, 236, 0.05), transparent 30%),
    radial-gradient(circle at top left,  rgba(16, 155, 109, 0.05), transparent 26%),
    linear-gradient(180deg, #f8fafd 0%, var(--bg) 100%);

  --shadow-soft:    0 4px 12px  rgba(15, 23, 42, 0.04);
  --shadow-card:    0 8px 24px  rgba(15, 23, 42, 0.06);
  --shadow-elev:    0 20px 44px rgba(15, 23, 42, 0.08);
  --shadow-strong:  0 28px 56px rgba(15, 23, 42, 0.12);
  --shadow-overlay: 0 24px 64px rgba(15, 23, 42, 0.18);

  --radius-panel: 24px;
  --radius-card:  18px;
  --radius-input: 14px;
  --radius-pill:  12px;
  --radius-round: 999px;

  --transition: 160ms ease;
  --transition-slow: 250ms cubic-bezier(0.32, 0.72, 0, 1);

  --font-ui:      "Manrope", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display: "Plus Jakarta Sans", "Manrope", ui-sans-serif, sans-serif;

  --fs-display: 40px;
  --fs-h1:      26px;
  --fs-h2:      20px;
  --fs-h3:      16px;
  --fs-body:    14px;
  --fs-sm:      13px;
  --fs-xs:      12px;
  --fs-eyebrow: 11px;

  --ls-display: -0.04em;
  --ls-h1:      -0.04em;
  --ls-h2:      -0.03em;
  --ls-tight:   -0.02em;
  --ls-eyebrow: 0.12em;
}

html { color-scheme: light; -webkit-text-size-adjust: 100%; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--page-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }

:where(button, input, textarea, select, a):focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── Skip link ── */
.skip-link {
  position: absolute;
  left: -9999px; top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  left: 16px; top: 16px;
  width: auto; height: auto;
  padding: 10px 14px;
  background: var(--text);
  color: #fff;
  border-radius: 8px;
  z-index: 9999;
}

/* ══════════════════════════════════════════════════════════
   Page shell
   ══════════════════════════════════════════════════════════ */
.auth-shell {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: stretch;
}

/* ── Left column (form) ── */
.auth-form-col {
  position: relative;
  padding: 32px 48px 48px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.auth-brand .isotipo { width: 28px; height: 28px; }
.auth-brand .wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.04em;
  color: var(--text);
}

.auth-topbar-right {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: var(--fs-sm);
  color: var(--muted);
  flex-wrap: wrap;
  justify-content: flex-end;
}
.auth-topbar-right a {
  color: var(--muted);
  transition: color var(--transition);
}
.auth-topbar-right a:hover { color: var(--accent); }

/* ── Card wrap ── */
.auth-form-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 0 40px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: fadeSlideIn 0.4s ease-out both;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 800;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--accent);
}
.auth-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: var(--text);
  margin: 0;
}
.auth-subtitle {
  font-size: 15px;
  color: var(--muted);
  margin: 10px 0 0;
  line-height: 1.55;
  max-width: 38ch;
  text-wrap: pretty;
}

/* ── Google button (real /auth/google/start link, styled as button) ── */
.google-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-input);
  font: 600 15px/1 var(--font-ui);
  letter-spacing: -0.005em;
  cursor: pointer;
  text-decoration: none;
  transition: border-color var(--transition), box-shadow var(--transition),
              transform var(--transition), background var(--transition);
  box-shadow: var(--shadow-soft);
}
.google-btn:hover {
  border-color: rgba(31,122,236,0.35);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
  color: var(--text);
}
.google-btn:active {
  transform: translateY(0);
  background: var(--surface-soft);
}
.google-btn .g-logo { width: 20px; height: 20px; flex: none; }

/* ── Helper block under button ── */
.auth-helper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.auth-helper b { color: var(--text); font-weight: 700; }
.auth-helper .row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.auth-helper svg { flex: none; color: var(--accent); margin-top: 1px; }

/* ── Error state (shown only when JS removes the [hidden] attribute) ── */
.auth-error {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  background: var(--danger-soft);
  border: 1px solid rgba(211,74,74,0.25);
  border-radius: var(--radius-input);
  color: #8c2c2c;
  font-size: 13px;
  line-height: 1.45;
  align-items: flex-start;
}
/* Ensure `hidden` wins over the flex display above. */
.auth-error[hidden] { display: none; }
.auth-error svg { color: var(--danger); margin-top: 1px; flex: none; }
.auth-error b { display: block; margin-bottom: 2px; color: #7a2828; }

/* ── Resume hint under button (adapts based on ?next=) ── */
.auth-resume-copy {
  margin: -8px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

/* ── Footer ── */
.auth-footer {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}
.auth-footer .links { display: inline-flex; gap: 16px; }
.auth-footer a { color: var(--muted); transition: color var(--transition); }
.auth-footer a:hover { color: var(--text); }
.auth-footer .copy { display: inline-flex; align-items: center; gap: 8px; }

/* ══════════════════════════════════════════════════════════
   Right column — product preview panel (edge-to-edge)
   ══════════════════════════════════════════════════════════ */
.auth-preview-col {
  position: relative;
  padding: 0;
  display: flex;
  min-height: 100vh;
}

.preview-panel {
  position: relative;
  flex: 1;
  background:
    radial-gradient(circle at 82% 8%, rgba(31,122,236,0.12), transparent 50%),
    radial-gradient(circle at 12% 88%, rgba(132,225,203,0.20), transparent 45%),
    linear-gradient(160deg, #eef4fb 0%, #e3ecf6 100%);
  border-radius: 0;
  overflow: hidden;
  color: var(--text);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
}

.preview-grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(15,26,39,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,26,39,0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(circle at 50% 40%, black 0%, transparent 70%);
          mask-image: radial-gradient(circle at 50% 40%, black 0%, transparent 70%);
  pointer-events: none;
}

.preview-head {
  position: relative;
  padding: 40px 48px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.preview-head .auth-brand {
  color: inherit;
}
.preview-head .auth-brand .wordmark {
  color: inherit;
  font-size: 20px;
}
.preview-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.preview-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin: 0;
  max-width: 18ch;
  text-wrap: balance;
  color: var(--text);
}
.preview-title .hl { color: var(--accent); }
.preview-sub {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 42ch;
  margin: 0;
}

.preview-stage {
  position: relative;
  flex: 1;
  padding: 32px 48px 40px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* ── Mini product frame ── */
.mini-app {
  position: relative;
  width: 100%;
  max-width: 640px;
  background: var(--bg);
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 30px 80px rgba(0,0,0,0.35),
    0 8px 20px rgba(0,0,0,0.2),
    inset 0 0 0 1px rgba(255,255,255,0.05);
  color: var(--text);
  transform: translateY(20px);
  animation: appRise 0.7s 0.1s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
@keyframes appRise {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(20px); opacity: 1; }
}

.mini-app-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #e4ecf5;
  border-bottom: 1px solid var(--line);
}
.mini-app-bar .dot {
  width: 10px; height: 10px; border-radius: 999px;
  background: #cbd5e1;
}
.mini-app-bar .dot.red    { background: #f37060; }
.mini-app-bar .dot.yellow { background: #f5c451; }
.mini-app-bar .dot.green  { background: #7ccf7c; }
.mini-app-bar .url {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.mini-app-inner {
  display: grid;
  grid-template-columns: 140px 1fr;
}
.mini-sidebar {
  background: var(--sidebar-gradient);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 300px;
}
.mini-sidebar .brand {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px 14px;
  color: white;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 15px;
}
.mini-sidebar .brand svg { width: 18px; height: 18px; }
.mini-sidebar .nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  font-weight: 600;
}
.mini-sidebar .nav-item.active {
  background: rgba(255,255,255,0.08);
  color: white;
}
.mini-sidebar .nav-item svg { width: 14px; height: 14px; opacity: 0.8; }

.mini-main {
  padding: 14px 16px 18px;
  background: var(--bg);
}
.mini-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.mini-header .kicker {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.mini-header .title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 2px 0 0;
}
.mini-header .pill-btn {
  padding: 4px 10px;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
}

.mini-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.mini-kpi {
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-soft) 100%);
  border: 1px solid rgba(215,225,236,0.8);
  border-radius: 12px;
  padding: 10px;
}
.mini-kpi .label {
  font-size: 9px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.mini-kpi .value {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.mini-kpi .delta {
  font-size: 9px;
  font-weight: 700;
  color: var(--success);
  margin-top: 4px;
}
.mini-kpi .delta.warn { color: var(--warning); }

.mini-list {
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-soft) 100%);
  border: 1px solid rgba(215,225,236,0.8);
  border-radius: 12px;
  padding: 10px;
}
.mini-list .row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-bottom: 1px solid rgba(215,225,236,0.5);
  font-size: 11px;
}
.mini-list .row:last-child { border-bottom: 0; }
.mini-list .avatar {
  width: 22px; height: 22px; border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  flex: none;
}
.mini-list .info { flex: 1; min-width: 0; }
.mini-list .name { font-weight: 700; color: var(--text); font-size: 11px; }
.mini-list .sub { font-size: 10px; color: var(--muted); }
.mini-list .pill-b {
  font-size: 9px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.mini-list .pill-b.ok { background: var(--success-soft); color: var(--success); }
.mini-list .pill-b.wa { background: rgba(37, 211, 102, 0.12); color: #1fa855; }
.mini-list .pill-b.warn { background: var(--warning-soft); color: var(--warning); }

/* ══════════════════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════════════════ */
@media (max-width: 1280px) {
  .auth-form-col { padding: 28px 36px 40px; }
  .preview-head { padding: 32px 36px 0; }
  .preview-stage { padding: 24px 36px 32px; }
}
@media (max-width: 1024px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-preview-col { display: none; }
  .auth-form-col { padding: 28px 32px 40px; }
}
@media (max-width: 720px) {
  .auth-form-col { padding: 24px 24px 36px; }
  .auth-form-wrap { padding: 24px 0 32px; }
  .auth-title { font-size: 30px; }
}
@media (max-width: 520px) {
  .auth-form-col { padding: 20px 18px 32px; }
  .auth-form-wrap { padding: 20px 0 28px; }
  .auth-title { font-size: 26px; }
  .auth-subtitle { font-size: 14px; }
  .auth-topbar { gap: 12px; }
  .auth-topbar-right { gap: 10px; font-size: 12px; }
  .auth-topbar-right .no-account { display: none; }
  .auth-brand .wordmark { font-size: 20px; }
  .google-btn { min-height: 52px; font-size: 14px; }
  .auth-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .auth-footer .links { flex-wrap: wrap; gap: 12px; }
}
@media (max-width: 380px) {
  .auth-form-col { padding: 18px 14px 28px; }
  .auth-title { font-size: 24px; }
  .auth-card { gap: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
