/* ===========================================================
   Canal Seguro — stylesheet
   Dark navy / blue theme matching the existing product screens.
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #090d18;
  --bg-elevated: #0d1424;
  --bg-card: #101a30;
  --border: rgba(148, 163, 184, 0.14);
  --accent: #3b6ef0;
  --accent-dim: #2451c4;
  --teal: #2a8f9e;
  --text: #f1f5f9;
  --text-dim: #90a0ba;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
}

h1, h2, h3 { font-family: 'Sora', sans-serif; margin: 0; letter-spacing: -0.01em; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--accent); }
.hidden { display: none !important; }

input, select, textarea {
  font-family: inherit;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: #4b5876; }
input:disabled { opacity: .6; }

.muted { color: var(--text-dim); }
.small-note { font-size: 12.5px; margin-top: 14px; }
.mono { font-family: 'SFMono-Regular', Consolas, monospace; }

.logo-mark {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.6px solid var(--teal);
  display: flex; align-items: center; justify-content: center;
  color: var(--teal);
  flex-shrink: 0;
  font-size: 14px;
}

/* ------------------------- Public header ------------------------- */
.public-header { position: sticky; top: 0; z-index: 40; background: rgba(9,13,24,0.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.public-header-inner { max-width: 1200px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 24px; position: relative; }
.brand { display: flex; align-items: center; gap: 10px; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 17px; cursor: pointer; background: none; border: none; color: var(--text); }
.public-nav { display: flex; gap: 22px; flex: 1; }
.public-nav button { background: none; border: none; color: var(--text-dim); font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 6px; padding: 6px 0; }
.public-nav button.active, .public-nav button:hover { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.burger { display: none; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 7px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 9px; border: none; font-weight: 600; font-size: 14px; padding: 10px 18px; transition: transform .1s, opacity .15s; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-dim)); color: white; box-shadow: 0 6px 20px rgba(59,110,240,0.28); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: rgba(148,163,184,0.08); border: 1px solid var(--border); color: var(--text); }
.btn-danger { background: var(--danger); color: white; }
.btn-lg { padding: 13px 26px; font-size: 15px; }
.btn-sm { padding: 7px 13px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ------------------------------- Hero ------------------------------- */
.hero { position: relative; padding: 80px 24px 60px; overflow: hidden; }
.hero-glow { position: absolute; top: -200px; left: 50%; transform: translateX(-50%); width: 900px; height: 500px; background: radial-gradient(circle, rgba(59,110,240,0.16), transparent 70%); pointer-events: none; }
.hero-inner { max-width: 720px; margin: 0 auto; text-align: center; position: relative; }
.hero-mark { width: 76px; height: 76px; border-radius: 50%; border: 1.5px solid var(--teal); color: var(--teal); display: flex; align-items: center; justify-content: center; margin: 0 auto 22px; font-size: 30px; }
.pill { display: inline-flex; align-items: center; gap: 7px; background: rgba(59,110,240,0.12); border: 1px solid rgba(59,110,240,0.3); color: var(--accent); padding: 7px 16px; border-radius: 999px; font-size: 12.5px; font-weight: 600; margin-bottom: 26px; }
.hero h1 { font-size: 46px; font-weight: 800; line-height: 1.12; margin-bottom: 22px; }
.hero p { color: var(--text-dim); font-size: 16px; max-width: 560px; margin: 0 auto 34px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.demo-link { background: none; border: none; color: var(--teal); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.demo-link:hover { text-decoration: underline; }

.features { padding: 20px 24px 90px; }
.features-inner { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 26px; }
.feature-icon { width: 44px; height: 44px; border-radius: 10px; background: rgba(59,110,240,0.12); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.feature-card h3 { font-size: 16px; margin-bottom: 8px; }
.feature-card p { color: var(--text-dim); font-size: 13.5px; margin: 0; }

.public-footer { border-top: 1px solid var(--border); padding: 34px 24px; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-title { font-family: 'Sora'; font-weight: 700; font-size: 14px; }
.footer-sub { color: var(--text-dim); font-size: 11.5px; }
.footer-links { display: flex; gap: 20px; color: var(--text-dim); font-size: 13px; }
.footer-links span { display: flex; align-items: center; gap: 6px; }
.footer-copy { width: 100%; text-align: center; color: #4b5876; font-size: 11.5px; margin-top: 6px; }

/* -------------------------------- Pages ------------------------------- */
.page-narrow { max-width: 680px; margin: 0 auto; padding: 48px 20px 80px; }
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.page-head p { color: var(--text-dim); font-size: 14px; margin: 0; }
.center-page { text-align: center; }
.center-title { font-size: 26px; font-weight: 700; margin: 18px 0 8px; font-family: 'Sora'; }
.center-sub { color: var(--text-dim); font-size: 14px; margin-bottom: 28px; }
.track-icon { width: 60px; height: 60px; border-radius: 50%; background: rgba(59,110,240,0.12); color: var(--accent); display: flex; align-items: center; justify-content: center; margin: 0 auto; font-size: 24px; }

.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 26px; margin-bottom: 20px; text-align: left; }
.form-card h3 { font-size: 15px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; margin-bottom: 6px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 18px; margin-bottom: 6px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: #cbd5e1; }
.field .req { color: var(--danger); }
.field .opt { color: var(--text-dim); font-weight: 400; font-size: 12px; margin-left: 4px; }
.field-error { color: var(--danger); font-size: 12px; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.icon-input { display: flex; align-items: center; gap: 8px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; }
.icon-input input { border: none; background: none; padding: 10px 0; }
.icon-input i { color: var(--text-dim); flex-shrink: 0; }
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { padding-right: 40px; }
.pw-wrap button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-dim); }

.form-footer-link { text-align: center; font-size: 13px; color: var(--text-dim); margin-top: 14px; }
.form-footer-link button { background: none; border: none; color: var(--accent); font-weight: 600; }
.link-btn { background: none; border: none; color: var(--accent); font-weight: 600; text-decoration: underline; padding: 0; }

.success-card, .login-card { max-width: 480px; margin: 0 auto; }
.success-icon, .login-icon { width: 64px; height: 64px; border-radius: 50%; background: rgba(34,197,94,0.14); color: var(--success); display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; font-size: 26px; }
.login-icon { background: rgba(59,110,240,0.14); color: var(--accent); }
.success-card h2, .login-card h2 { font-size: 21px; margin-bottom: 10px; }
.success-card p, .login-card p { color: var(--text-dim); font-size: 14px; }
.mail-preview { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; padding: 14px; text-align: left; margin: 18px 0; }
.mail-preview-head { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.mail-preview p { color: var(--text); font-size: 13px; margin: 0; }
.login-links { display: flex; justify-content: space-between; margin-top: 16px; }
.login-links button { background: none; border: none; color: var(--text-dim); font-size: 12.5px; }
.login-links button:hover { color: var(--accent); }

.company-pick-list { display: flex; flex-direction: column; gap: 8px; }
.company-pick-item { display: flex; align-items: center; gap: 14px; width: 100%; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; color: var(--text); text-align: left; }
.company-pick-item:hover { border-color: var(--accent); }
.company-pick-avatar { width: 36px; height: 36px; border-radius: 8px; background: rgba(59,110,240,0.16); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.company-pick-name { font-weight: 600; font-size: 14px; }
.company-pick-sub { color: var(--text-dim); font-size: 12px; }

.anon-banner { display: flex; align-items: center; gap: 9px; background: rgba(42,143,158,0.1); border: 1px solid rgba(42,143,158,0.3); color: var(--teal); padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 18px; }
.upload-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 1.5px dashed var(--border); border-radius: 10px; padding: 28px; color: var(--text-dim); font-size: 13.5px; cursor: pointer; text-align: center; }
.upload-drop:hover { border-color: var(--accent); }
.upload-drop i { color: var(--accent); margin-bottom: 4px; font-size: 20px; }
.upload-hint { font-size: 11.5px; color: #4b5876; }
.upload-drop.small { flex-direction: row; padding: 14px; }
.logo-preview { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; }
.audio-record-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.rec-dot { width: 7px; height: 7px; border-radius: 50%; background: white; display: inline-block; margin: 0 4px; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.anexo-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; }
.anexo-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; background: var(--bg-elevated); border-radius: 7px; padding: 7px 10px; }
.anexo-list li button { margin-left: auto; background: none; border: none; color: var(--text-dim); }
.anexo-list.static li { background: none; padding: 4px 0; }

.identify-box { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin: 16px 0; }
.checkbox-row { display: flex; align-items: center; gap: 9px; font-size: 13.5px; cursor: pointer; margin-bottom: 8px; }
.checkbox-row input { width: auto; }

.protocol-box { font-family: 'Sora'; font-size: 22px; font-weight: 700; color: var(--accent); background: rgba(59,110,240,0.1); border: 1px solid rgba(59,110,240,0.3); border-radius: 10px; padding: 14px; margin: 14px 0 20px; letter-spacing: 0.5px; }
.protocol-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px; }

.alert-card { display: flex; align-items: center; gap: 10px; color: var(--warning); border-color: rgba(245,158,11,0.3); }
.result-card { text-align: left; }
.result-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.result-protocol { font-family: 'Sora'; font-size: 18px; font-weight: 700; }
.result-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.badge { display: inline-flex; align-items: center; gap: 6px; border: 1px solid; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge .dot, .dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.timeline { margin-top: 14px; display: flex; flex-direction: column; gap: 16px; }
.timeline-item { display: flex; gap: 12px; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.timeline-status { font-weight: 600; font-size: 13.5px; }
.timeline-date { font-size: 12px; }
.timeline-note { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }

/* --------------------------- Dashboard shell --------------------------- */
.dash-shell { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--bg-elevated); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; flex-shrink: 0; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 22px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.sidebar-company { font-family: 'Sora'; font-weight: 700; font-size: 14px; }
.sidebar-sub { color: var(--text-dim); font-size: 11px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.sidebar-nav button { display: flex; align-items: center; gap: 11px; background: none; border: none; color: var(--text-dim); text-align: left; padding: 10px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 500; }
.sidebar-nav button:hover { background: rgba(148,163,184,0.06); color: var(--text); }
.sidebar-nav button.active { background: rgba(59,110,240,0.14); color: var(--accent); }
.sidebar-logout { display: flex; align-items: center; gap: 11px; background: none; border: 1px solid var(--border); color: var(--text-dim); padding: 10px 12px; border-radius: 8px; font-size: 13.5px; margin-top: 10px; }
.sidebar-logout:hover { color: var(--danger); border-color: var(--danger); }
.dash-main { flex: 1; padding: 26px 32px 60px; min-width: 0; }
.dash-topbar { display: none; justify-content: space-between; margin-bottom: 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 18px; display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 17px; }
.stat-value { font-family: 'Sora'; font-size: 22px; font-weight: 700; line-height: 1; }
.stat-label { color: var(--text-dim); font-size: 12px; margin-top: 4px; }

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
.chart-card h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 14px; }
.avg-card { display: flex; flex-direction: column; justify-content: center; }
.avg-value { font-family: 'Sora'; font-size: 40px; font-weight: 800; color: var(--accent); margin: 4px 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--text-dim); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
td { padding: 12px 10px; border-bottom: 1px solid var(--border); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: rgba(148,163,184,0.05); }

.filter-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-tabs button { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-dim); padding: 7px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.filter-tabs button.active { background: rgba(59,110,240,0.16); border-color: var(--accent); color: var(--accent); }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: flex-start; justify-content: center; z-index: 100; padding: 40px 16px; overflow-y: auto; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; max-width: 640px; width: 100%; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 24px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 18px; margin-top: 4px; }
.modal-head button { background: none; border: none; color: var(--text-dim); }
.modal-body { padding: 22px 24px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; font-size: 13.5px; }
.detail-block { margin-bottom: 18px; font-size: 13.5px; }
.detail-block p { margin: 6px 0 0; }
.status-btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.status-pick { background: transparent; border: 1px solid var(--border); color: var(--text-dim); padding: 7px 13px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.status-pick.active { background: color-mix(in srgb, var(--c) 18%, transparent); border-color: var(--c); color: var(--c); }

.link-box { display: flex; align-items: center; gap: 10px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; flex-wrap: wrap; }
.link-box span.mono { flex: 1; font-size: 13px; color: var(--accent); }

.icon-btn { background: none; border: 1px solid var(--border); border-radius: 7px; padding: 6px; color: var(--text-dim); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }

.loading-block { text-align: center; padding: 80px 0; color: var(--text-dim); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: #10241a; border: 1px solid rgba(34,197,94,0.4); color: #86efac; padding: 12px 20px; border-radius: 10px; display: flex; align-items: center; gap: 8px; font-size: 13.5px; z-index: 200; box-shadow: 0 10px 30px rgba(0,0,0,0.3); opacity: 0; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .public-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-elevated); flex-direction: column; padding: 10px 24px; gap: 4px; display: none; border-bottom: 1px solid var(--border); }
  .public-nav.open { display: flex; }
  .burger { display: flex; }
  .header-actions .btn-ghost span { display: none; }
  .chart-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .sidebar { position: fixed; left: -260px; top: 0; z-index: 90; transition: left .2s; box-shadow: 0 0 40px rgba(0,0,0,0.4); }
  .sidebar.open { left: 0; }
  .dash-topbar { display: flex; }
  .dash-main { padding: 18px; }
  .detail-grid { grid-template-columns: 1fr; }
}
