/* ===================================================================
   PowerOn Partners — Light Mode (estilo onpoweron.com)
   =================================================================== */

/* ── Reset & Variables ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Fundos */
  --canvas:       #F8FAFC;
  --canvas-1:     #F1F5F9;
  --surface:      #FFFFFF;

  /* Texto */
  --ink:          #0F172A;
  --muted:        #64748B;
  --subtle:       #94A3B8;

  /* Accent (primary) */
  --primary:      #2563EB;
  --primary-dim:  #1D4ED8;
  --primary-light: #EFF6FF;
  --primary-glow: rgba(37,99,235,0.10);

  /* Status */
  --success:      #00C853;
  --success-light:#ECFDF5;
  --danger:       #EF4444;
  --danger-light: #FEF2F2;
  --warning:      #F59E0B;
  --warning-light:#FFF7ED;
  --info:         #38BDF8;

  /* Bordas */
  --line:         rgba(15,23,42,0.08);
  --line-blue:    rgba(37,99,235,0.22);
  --line-green:   rgba(0,200,83,0.22);

  /* Sombras */
  --shadow-card:  0 1px 3px rgba(15,23,42,0.06), 0 4px 16px rgba(15,23,42,0.05);
  --shadow-card-hover: 0 2px 8px rgba(15,23,42,0.08), 0 8px 28px rgba(37,99,235,0.10);
  --shadow-blue:  0 4px 20px rgba(37,99,235,0.18);

  /* Layout */
  --sidebar-w:  240px;
  --header-h:   60px;
}

html { font-size: 14px; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }

/* ── Auth shell ─────────────────────────────────────────────── */
#auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--canvas);
  padding: 1rem;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-card);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}
.logo-mark { font-size: 1.5rem; }
.logo-text  {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
}

.auth-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--ink);
}

.auth-divider {
  text-align: center;
  position: relative;
  margin: 1.25rem 0;
  color: var(--muted);
  font-size: 0.8125rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--line);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

.auth-footer {
  text-align: center;
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.875rem;
}

/* ── App shell ───────────────────────────────────────────────── */
#app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--line);
}
.brand-name {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.brand-name span { color: var(--primary); }
.brand-tag {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-top: 0.25rem;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
  overflow-y: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 1.25rem;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 0 0.375rem 0.375rem 0;
  transition: background 0.15s, color 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-link:hover {
  background: var(--primary-light);
  color: var(--ink);
  text-decoration: none;
}
.nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  border-right: 3px solid var(--primary);
}
.nav-icon { font-size: 1rem; width: 1.25rem; text-align: center; }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--line);
}
.sidebar-user { font-size: 0.8125rem; color: var(--muted); }
.sidebar-user strong { display: block; color: var(--ink); font-weight: 600; font-size: 0.875rem; }

/* Header */
.app-header {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 1.5rem;
  z-index: 90;
  gap: 1rem;
}
.header-info { text-align: right; }
.header-name { font-weight: 600; font-size: 0.9rem; }
.header-biz  { font-size: 0.8rem; color: var(--muted); }

/* Main content */
.app-main {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  padding: 2rem 1.75rem;
  flex: 1;
  min-height: calc(100vh - var(--header-h));
}

/* ── Forms ───────────────────────────────────────────────────── */
.auth-form { display: flex; flex-direction: column; gap: 1rem; }

.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field label { font-size: 0.8125rem; font-weight: 600; color: var(--ink); }
.field-hint { font-size: 0.75rem; color: var(--muted); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, box-shadow 0.15s;
  text-decoration: none;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-full { width: 100%; }

.btn-primary  {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dim);
  box-shadow: var(--shadow-blue);
  text-decoration: none;
}
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover { background: var(--canvas); }
.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
  border-color: rgba(239,68,68,0.2);
}
.btn-danger:hover { background: rgba(239,68,68,0.15); }

.btn-google {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-google:hover { background: var(--canvas); text-decoration: none; }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}
.alert-error {
  background: var(--danger-light);
  color: #991b1b;
  border: 1px solid rgba(239,68,68,0.2);
}
.alert-success {
  background: var(--success-light);
  color: #166534;
  border: 1px solid rgba(0,200,83,0.2);
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}
.card-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card--stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.card-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.card-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
}
.card-value small {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 400;
}
.card-sub { font-size: 0.8rem; color: var(--muted); }

/* ── Tables ──────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--canvas-1);
}
.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--ink);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tfoot td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  border-top: 2px solid var(--line);
}
.data-table tbody tr:hover td {
  background: var(--primary-light);
}

.cell-main { font-weight: 500; }
.cell-sub  { font-size: 0.8rem; color: var(--muted); margin-top: 0.1rem; }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--muted); }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge--green  { background: var(--success-light); color: #166534; }
.badge--grey   { background: var(--canvas-1); color: #475569; }
.badge--yellow { background: var(--warning-light); color: #92400e; }
.badge--blue   { background: var(--primary-light); color: #1e40af; }
.badge--red    { background: var(--danger-light); color: #991b1b; }

/* ── Page header ─────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
}
.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--muted);
}

/* ── Filter bar ──────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.filter-bar input, .filter-bar select { width: auto; }

/* ── Profile ─────────────────────────────────────────────────── */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.def-list { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1rem; font-size: 0.9rem; }
.def-list dt { color: var(--muted); font-weight: 500; }
.def-list dd { font-weight: 500; }

/* ── Spinner & loading ───────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-row { display: flex; justify-content: center; padding: 3rem; }

/* ── Verify email ────────────────────────────────────────────── */
.verify-state { text-align: center; padding: 1rem 0; }
.verify-state h2 { margin: 1rem 0 0.5rem; }
.verify-icon { font-size: 3rem; line-height: 1; }
.verify-icon--ok    { color: var(--success); }
.verify-icon--error { color: var(--danger); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s;
  }
  .sidebar.open { transform: translateX(0); }

  .app-header { left: 0; }
  .app-main { margin-left: 0; }

  .mobile-menu-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    margin-right: auto;
  }
  .mobile-menu-btn span {
    display: block;
    width: 1.25rem;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
  }

  .cards-grid { grid-template-columns: 1fr 1fr; }
  .profile-grid { grid-template-columns: 1fr; }

  .data-table th, .data-table td { padding: 0.625rem 0.75rem; }
}

@media (min-width: 769px) {
  .mobile-menu-btn { display: none; }
}

/* ── Language switcher ────────────────────────────────────────── */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--subtle);
}
.lang-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.2rem 0.35rem;
  border-radius: 0.25rem;
  letter-spacing: 0.04em;
  transition: color 0.15s;
}
.lang-btn:hover { color: var(--ink); }
.lang-btn--active {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Help tooltips ────────────────────────────────────────────── */
.help-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  vertical-align: middle;
}
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  cursor: default;
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
}
.help-bubble {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #f8fafc;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.45;
  padding: 8px 11px;
  border-radius: 6px;
  min-width: 200px;
  max-width: 260px;
  text-align: left;
  white-space: normal;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 9000;
}
.help-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1e293b;
}
.help-tooltip:hover .help-bubble,
.help-tooltip:focus-within .help-bubble,
.help-tooltip.open .help-bubble {
  opacity: 1;
}

/* ── Help button (sidebar) ────────────────────────────────────── */
.help-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 1.25rem;
  margin-bottom: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  border-radius: 0.375rem;
  transition: background 0.15s, color 0.15s;
}
.help-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.help-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Help center modal ────────────────────────────────────────── */
.hc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.45);
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.2s;
}
.hc-overlay.hc-visible { opacity: 1; }

.hc-panel {
  background: var(--surface);
  border-radius: 1rem;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(15,23,42,0.2);
  transform: translateY(12px);
  transition: transform 0.2s;
}
.hc-overlay.hc-visible .hc-panel { transform: translateY(0); }

.hc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.hc-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}
.hc-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--muted);
  padding: 0.25rem 0.5rem;
  line-height: 1;
  border-radius: 0.375rem;
  transition: background 0.15s, color 0.15s;
}
.hc-close:hover { background: var(--canvas-1); color: var(--ink); }

.hc-tabs {
  display: flex;
  padding: 0 1rem;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}
.hc-tabs::-webkit-scrollbar { display: none; }

.hc-tab {
  padding: 0.75rem 0.875rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.15s;
}
.hc-tab:hover { color: var(--ink); }
.hc-tab.hc-active { color: var(--primary); border-bottom-color: var(--primary); }

.hc-body {
  padding: 0.5rem 1.5rem 1rem;
  overflow-y: auto;
  flex: 1;
}

.hc-faq { display: flex; flex-direction: column; }
.hc-faq-item { border-bottom: 1px solid var(--line); }
.hc-faq-item:last-child { border-bottom: none; }

.hc-faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: color 0.15s;
}
.hc-faq-q:hover { color: var(--primary); }

.hc-faq-chevron {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--muted);
  transition: transform 0.2s;
}
.hc-faq-item.hc-open .hc-faq-chevron { transform: rotate(180deg); }

.hc-faq-a {
  display: none;
  font-size: 0.855rem;
  color: var(--muted);
  line-height: 1.65;
  padding-bottom: 1rem;
}
.hc-faq-item.hc-open .hc-faq-a { display: block; }

.hc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.hc-footer-text { font-size: 0.875rem; color: var(--muted); }

@media (max-width: 768px) {
  .hc-panel { max-height: 95vh; border-radius: 0.75rem; }
  .hc-body  { padding: 0.5rem 1rem 1rem; }
  .hc-header, .hc-footer { padding: 1rem; }
}

/* ── OAuth notice (perfil Google) ─────────────────────────── */
.oauth-notice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1rem;
  background: var(--canvas-1);
  border-radius: 0.75rem;
  text-align: center;
}
.oauth-icon {
  font-size: 2rem;
  line-height: 1;
}
.oauth-notice p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 320px;
}

/* ── Password policy hint ─────────────────────────────────── */
.password-policy {
  display: flex;
  align-items: flex-start;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--subtle);
  margin-top: 0.35rem;
}
.password-policy::before {
  content: 'ℹ';
  flex-shrink: 0;
  font-style: normal;
}

.pw-policy-feedback {
  display: block;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  font-weight: 500;
}
.pw-policy-feedback.hidden { display: none; }
.pw-policy-feedback.pw-valid   { color: var(--success); }
.pw-policy-feedback.pw-invalid { color: var(--danger); }

/* ── Password strength bar ────────────────────────────────── */
.pw-strength-bar {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  margin-top: 0.4rem;
  overflow: hidden;
}
.pw-strength-fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width 0.25s ease, background-color 0.25s ease;
  background: var(--subtle);
}
.pw-strength-fill.pw-strength-weak   { background: var(--danger); }
.pw-strength-fill.pw-strength-medium { background: var(--warning); }
.pw-strength-fill.pw-strength-strong { background: var(--success); }
