/* ═══════════════════════════════════════════════════════════
   MisCuentas — Design System v2
   Tema: Blanco / Azul / Celeste / Gris
   Tipografía: Inter + sistema redondeado
═══════════════════════════════════════════════════════════ */

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

:root {
  --blue-50:  #f0f5ff;
  --blue-100: #e8effe;
  --blue-200: #c7d7fa;
  --blue-500: #3b82f6;
  --blue-600: #1e4db7;
  --blue-700: #1d3f9a;
  --blue-800: #0c2d7a;
  --sky-400:  #38bdf8;
  --sky-500:  #0ea5e9;
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #4a5568;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --green-50: #f0fdf4;
  --green-500:#22c55e;
  --green-600:#16a34a;
  --orange-50:#fff7ed;
  --orange-600:#c2410c;
  --red-50:   #fff1f2;
  --red-600:  #dc2626;
  --purple-50:#fdf4ff;
  --radius-sm:  8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 20px rgba(30,77,183,.08);
  --shadow-lg: 0 8px 40px rgba(30,77,183,.12);
  --transition: .2s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #fff;
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── NAVBAR ──────────────────────────────────────────────── */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem;
  background: #fff;
  border-bottom: 0.5px solid var(--gray-200);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; max-width: 1200px; margin: 0 auto;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.2rem; font-weight: 700; color: var(--blue-600);
  text-decoration: none;
}
.brand-icon {
  width: 36px; height: 36px;
  background: var(--blue-600); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .9rem;
}
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a {
  color: var(--gray-600); text-decoration: none;
  font-size: .9rem; font-weight: 500;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--blue-600); }
.nav-user { color: var(--gray-600); font-size: .9rem; font-weight: 500; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .65rem 1.5rem;
  background: var(--blue-600);
  color: #ffffff !important;
  font-family: 'Inter', sans-serif; font-size: .9rem; font-weight: 700;
  border: none; border-radius: var(--radius-full);
  cursor: pointer; text-decoration: none;
  transition: var(--transition);
  -webkit-font-smoothing: antialiased;
}
.btn-primary:hover {
  background: var(--blue-700);
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(30,77,183,.3);
}
.btn-primary:visited { color: #ffffff !important; }

.btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .65rem 1.5rem;
  background: #fff; color: var(--blue-600);
  font-family: 'Inter', sans-serif; font-size: .9rem; font-weight: 600;
  border: 1.5px solid var(--blue-200); border-radius: var(--radius-full);
  cursor: pointer; text-decoration: none;
  transition: var(--transition);
}
.btn-outline:hover { border-color: var(--blue-600); background: var(--blue-50); }

.btn-full { width: 100%; }
.btn-pay  { font-size: 1rem; padding: .85rem 1.5rem; }

/* ── HERO ────────────────────────────────────────────────── */
.hero {
  padding: 5rem 2rem 4rem;
  background: linear-gradient(180deg, var(--blue-50) 0%, #fff 70%);
  text-align: center;
}
.hero-inner { max-width: 700px; margin: 0 auto; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--blue-100); color: var(--blue-600);
  padding: .4rem 1.1rem; border-radius: var(--radius-full);
  font-size: .8rem; font-weight: 600;
  border: 0.5px solid var(--blue-200);
  margin-bottom: 1.5rem;
}
.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800; line-height: 1.15;
  color: var(--gray-900); margin-bottom: 1.2rem;
  letter-spacing: -.02em;
}
.hero-title em { font-style: normal; color: var(--blue-600); }
.hero-sub { font-size: 1.1rem; color: var(--gray-500); margin-bottom: 2rem; }

.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2rem; }
.hero-trust { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; }
.hero-trust span { font-size: .85rem; color: var(--gray-500); display: flex; align-items: center; gap: 5px; }

/* Dashboard preview */
.dashboard-preview {
  background: #fff;
  border: 0.5px solid var(--gray-200);
  border-radius: var(--radius-xl);
  max-width: 860px; margin: 3rem auto 0;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.dp-header {
  background: var(--gray-50);
  border-bottom: 0.5px solid var(--gray-200);
  padding: .75rem 1.2rem;
  display: flex; align-items: center; gap: 8px;
}
.dp-dots { display: flex; gap: 5px; }
.dp-dot  { width: 10px; height: 10px; border-radius: 50%; }
.dp-title { font-size: .78rem; color: var(--gray-400); margin-left: .5rem; font-weight: 500; }
.dp-body { display: grid; grid-template-columns: 210px 1fr; min-height: 320px; }

.dp-sidebar {
  background: var(--gray-50);
  border-right: 0.5px solid var(--gray-200);
  padding: 1.2rem 1rem;
}
.dp-sidebar-section {
  font-size: .68rem; color: var(--gray-400); font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em;
  margin-bottom: .6rem; padding-left: .5rem;
}
.dp-sidebar-item {
  display: flex; align-items: center; gap: 8px;
  padding: .5rem .7rem; border-radius: var(--radius-sm);
  font-size: .82rem; color: var(--gray-600); margin-bottom: 2px;
  cursor: pointer; transition: var(--transition);
}
.dp-sidebar-item:hover { background: var(--gray-100); color: var(--gray-800); }
.dp-sidebar-item.active { background: var(--blue-100); color: var(--blue-600); font-weight: 600; }

.dp-content { padding: 1.3rem; }
.dp-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: .7rem; margin-bottom: 1rem; }
.dp-stat {
  background: var(--gray-50); border-radius: var(--radius-md);
  padding: .85rem; border: 0.5px solid var(--gray-200);
}
.dp-stat-label { font-size: .7rem; color: var(--gray-400); font-weight: 500; margin-bottom: .3rem; }
.dp-stat-val   { font-size: 1.2rem; font-weight: 700; color: var(--gray-900); }
.dp-stat-sub   { font-size: .7rem; color: var(--green-600); margin-top: .2rem; }
.dp-stat-sub.warn { color: var(--orange-600); }

.dp-accounts { display: grid; gap: .5rem; }
.dp-account {
  display: flex; align-items: center; gap: .8rem;
  padding: .6rem .8rem;
  background: #fff; border: 0.5px solid var(--gray-200);
  border-radius: var(--radius-md); transition: var(--transition);
}
.dp-account:hover { border-color: var(--blue-200); box-shadow: var(--shadow-sm); }
.dp-acc-icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; flex-shrink: 0;
}
.dp-acc-info { flex: 1; min-width: 0; }
.dp-acc-name { font-size: .8rem; font-weight: 600; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-acc-co   { font-size: .7rem; color: var(--gray-400); }
.dp-acc-amount { font-size: .82rem; font-weight: 700; color: var(--blue-600); white-space: nowrap; }

/* ── BADGES ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  font-size: .68rem; font-weight: 600;
  padding: .2rem .6rem; border-radius: var(--radius-full);
  white-space: nowrap;
}
.badge-due    { background: var(--orange-50); color: var(--orange-600); border: 0.5px solid #fed7aa; }
.badge-ok     { background: var(--green-50);  color: var(--green-600);  border: 0.5px solid #bbf7d0; }
.badge-paid   { background: var(--blue-100);  color: var(--blue-600);   border: 0.5px solid var(--blue-200); }
.badge-danger { background: var(--red-50);    color: var(--red-600);    border: 0.5px solid #fecaca; }

/* ── SECTIONS ────────────────────────────────────────────── */
.section { padding: 5rem 2rem; }
.section-inner { max-width: 1100px; margin: 0 auto; }
.section-bg   { background: var(--gray-50); }
.section-blue { background: var(--blue-50); }

.section-header { text-align: center; margin-bottom: 3rem; }
.section-label {
  display: inline-block;
  font-size: .75rem; font-weight: 700; color: var(--blue-600);
  text-transform: uppercase; letter-spacing: .1em; margin-bottom: .6rem;
}
.section-header h2 {
  font-size: 2rem; font-weight: 800; color: var(--gray-900);
  margin-bottom: .8rem; letter-spacing: -.02em;
}
.section-header p { font-size: 1rem; color: var(--gray-500); max-width: 520px; margin: 0 auto; }

/* ── FEATURE CARDS ───────────────────────────────────────── */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); gap: 1.5rem; }
.feature-card {
  background: #fff; border: 0.5px solid var(--gray-200);
  border-radius: var(--radius-lg); padding: 1.8rem;
  transition: var(--transition);
}
.feature-card:hover { border-color: var(--blue-200); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: 1.2rem;
}
.fi-blue   { background: var(--blue-100); }
.fi-sky    { background: #e0f7fe; }
.fi-green  { background: var(--green-50); }
.fi-purple { background: var(--purple-50); }
.fi-orange { background: var(--orange-50); }
.feature-card h3 { font-size: 1rem; font-weight: 700; color: var(--gray-900); margin-bottom: .5rem; }
.feature-card p  { font-size: .875rem; color: var(--gray-500); line-height: 1.6; }

/* ── STEPS ───────────────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 2rem; }
.step { text-align: center; }
.step-num {
  width: 52px; height: 52px;
  background: var(--blue-600); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 700;
  margin: 0 auto 1rem;
  box-shadow: 0 4px 16px rgba(30,77,183,.25);
}
.step h3 { font-size: .95rem; font-weight: 700; color: var(--gray-900); margin-bottom: .4rem; }
.step p  { font-size: .85rem; color: var(--gray-500); }

/* ── CHECKOUT ────────────────────────────────────────────── */
.checkout-page { max-width: 900px; margin: 0 auto; padding: 2.5rem 2rem; }
.checkout-header { margin-bottom: 2rem; }
.back-link {
  color: var(--gray-400); text-decoration: none; font-size: .9rem;
  display: inline-flex; align-items: center; gap: .3rem;
  margin-bottom: 1.2rem; font-weight: 500; transition: color var(--transition);
}
.back-link:hover { color: var(--blue-600); }
.checkout-company { display: flex; align-items: center; gap: 1.2rem; }
.co-icon { width: 60px; height: 60px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.co-icon.electricity { background: var(--orange-50); }
.co-icon.water       { background: #eff6ff; }
.co-icon.gas         { background: var(--purple-50); }
.co-icon.other       { background: var(--gray-100); }
.checkout-company h1 { font-size: 1.6rem; font-weight: 800; color: var(--gray-900); letter-spacing: -.02em; }
.checkout-company p  { color: var(--gray-500); font-size: .9rem; }

.checkout-card {
  background: #fff; border: 0.5px solid var(--gray-200);
  border-radius: var(--radius-xl); padding: 2.5rem; box-shadow: var(--shadow-sm);
}
.checkout-card h2 { font-size: 1.3rem; font-weight: 700; color: var(--gray-900); margin-bottom: .5rem; }
.form-hint { color: var(--gray-500); font-size: .9rem; margin-bottom: 2rem; }

/* ── FORMS ───────────────────────────────────────────────── */
.form-group { margin-bottom: 1.3rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; color: var(--gray-700); margin-bottom: .45rem; }
.optional { color: var(--gray-400); font-weight: 400; }

.form-input {
  width: 100%; padding: .8rem 1rem;
  background: var(--gray-50); border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md); color: var(--gray-900);
  font-family: 'Inter', sans-serif; font-size: .95rem;
  transition: var(--transition); outline: none;
}
.form-input:focus { border-color: var(--blue-500); background: #fff; box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.form-input::placeholder { color: var(--gray-300); }
select.form-input { cursor: pointer; }
textarea.form-input { resize: vertical; }

.input-hint { display: block; font-size: .75rem; color: var(--gray-400); margin-top: .35rem; }

.fee-notice {
  padding: .9rem 1.1rem;
  background: #fff7ed; border: 1px solid #fed7aa;
  border-radius: var(--radius-md); font-size: .85rem; color: var(--orange-600);
  margin-bottom: 1.5rem;
}
.support-line { margin-top: 1.5rem; text-align: center; font-size: .85rem; color: var(--gray-400); }
.support-line a { color: var(--blue-600); text-decoration: none; font-weight: 500; }

/* Summary */
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 700px) { .summary-grid { grid-template-columns: 1fr; } }
.summary-card {
  background: #fff; border: 0.5px solid var(--gray-200);
  border-radius: var(--radius-xl); padding: 2rem; box-shadow: var(--shadow-sm);
}
.summary-card h3 { font-size: .75rem; font-weight: 700; color: var(--gray-400); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 1.5rem; }

.detail-rows { margin-bottom: 1.5rem; }
.detail-row { display: flex; justify-content: space-between; padding: .65rem 0; border-bottom: 0.5px solid var(--gray-100); font-size: .9rem; }
.detail-row span   { color: var(--gray-500); }
.detail-row strong { color: var(--gray-900); font-weight: 600; }

.amount-breakdown { border-top: 1px solid var(--gray-100); padding-top: 1rem; }
.amount-row { display: flex; justify-content: space-between; padding: .4rem 0; font-size: .9rem; color: var(--gray-500); }
.amount-row.fee   { color: var(--orange-600); font-size: .85rem; }
.amount-row.total { color: var(--gray-900); font-weight: 700; font-size: 1.1rem; padding-top: .8rem; border-top: 1.5px solid var(--gray-200); margin-top: .4rem; }

.webpay-logos { display: flex; align-items: center; gap: .8rem; margin: 1.5rem 0 1rem; color: var(--gray-500); font-size: .85rem; }
.webpay-badge { display: flex; align-items: center; gap: .2rem; }
.wp-logo     { font-family: 'Inter', sans-serif; font-weight: 900; font-size: 1rem; color: #e21b1b; letter-spacing: -.02em; }
.wp-sub      { font-size: .7rem; color: var(--gray-400); }
.wp-logo-big { font-family: 'Inter', sans-serif; font-weight: 900; font-size: 1.5rem; color: #e21b1b; }
.wp-sub-big  { font-size: .9rem; color: var(--gray-400); }
.payment-security { font-size: .75rem; color: var(--gray-400); text-align: center; margin-top: .8rem; }

/* ── RESULT PAGES ────────────────────────────────────────── */
.result-page { min-height: calc(100vh - 120px); display: flex; align-items: center; justify-content: center; padding: 2rem; }
.result-card { background: #fff; border: 0.5px solid var(--gray-200); border-radius: var(--radius-xl); padding: 3rem; max-width: 560px; width: 100%; text-align: center; box-shadow: var(--shadow-md); }
.result-icon { width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; margin: 0 auto 1.5rem; font-weight: 800; }
.success-icon { background: var(--green-50); color: var(--green-600); border: 2px solid #bbf7d0; }
.failed-icon  { background: var(--red-50);   color: var(--red-600);   border: 2px solid #fecaca; }
.result-card h1 { font-size: 1.6rem; font-weight: 800; color: var(--gray-900); margin-bottom: .5rem; letter-spacing: -.02em; }
.result-sub { color: var(--gray-500); margin-bottom: 2rem; }

.receipt-detail-card { background: var(--gray-50); border-radius: var(--radius-md); padding: 1.2rem 1.5rem; margin-bottom: 2rem; text-align: left; border: 0.5px solid var(--gray-200); }
.receipt-row { display: flex; justify-content: space-between; padding: .5rem 0; font-size: .9rem; border-bottom: 0.5px solid var(--gray-100); }
.receipt-row:last-child { border: none; }
.receipt-row span { color: var(--gray-500); }
.amount-green { color: var(--green-600); font-weight: 700; }
.mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: .85rem; }

.result-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.5rem; }
.email-notice { font-size: .8rem; color: var(--gray-400); }
.failure-reason { background: var(--red-50); border: 1px solid #fecaca; border-radius: var(--radius-md); padding: .9rem 1.2rem; font-size: .9rem; color: var(--red-600); margin-bottom: 1.5rem; text-align: left; }
.result-suggestions { text-align: left; background: var(--gray-50); border-radius: var(--radius-md); padding: 1.2rem 1.5rem; margin-bottom: 2rem; border: 0.5px solid var(--gray-200); }
.result-suggestions h3 { font-size: .9rem; font-weight: 600; margin-bottom: .8rem; color: var(--gray-600); }
.result-suggestions ul { padding-left: 1.2rem; }
.result-suggestions li { font-size: .85rem; color: var(--gray-500); margin-bottom: .4rem; }

/* ── AUTH PAGES ──────────────────────────────────────────── */
.auth-body { background: var(--gray-50); }
.auth-container { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; }
.auth-brand { text-align: center; margin-bottom: 2rem; }
.auth-brand .brand-icon { width: 56px; height: 56px; font-size: 1.4rem; border-radius: 16px; background: var(--blue-600); display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; box-shadow: 0 8px 24px rgba(30,77,183,.3); }
.auth-brand h1 { font-size: 1.8rem; font-weight: 800; color: var(--gray-900); letter-spacing: -.02em; }
.auth-brand p  { color: var(--gray-500); font-size: .9rem; }
.auth-card { background: #fff; border: 0.5px solid var(--gray-200); border-radius: var(--radius-xl); padding: 2.5rem; width: 100%; max-width: 420px; box-shadow: var(--shadow-md); }
.auth-card h2 { font-size: 1.3rem; font-weight: 700; color: var(--gray-900); margin-bottom: 1.8rem; }
.auth-footer { margin-top: 1.5rem; text-align: center; font-size: .85rem; color: var(--gray-500); }
.auth-footer a { color: var(--blue-600); text-decoration: none; font-weight: 600; }
.auth-demo { margin-top: 1.2rem; padding: .8rem 1rem; background: var(--blue-100); border-radius: var(--radius-md); font-size: .8rem; color: var(--blue-600); text-align: center; }

/* ── ALERTS ──────────────────────────────────────────────── */
.alert { padding: .9rem 1.2rem; border-radius: var(--radius-md); margin: 1rem 0; font-size: .9rem; font-weight: 500; }
.alert p { margin: .2rem 0; }
.alert-error   { background: var(--red-50);   border: 1px solid #fecaca; color: var(--red-600); }
.alert-success { background: var(--green-50); border: 1px solid #bbf7d0; color: var(--green-600); }
.alert-warning { background: var(--orange-50);border: 1px solid #fed7aa; color: var(--orange-600); }

/* ── MOCK WEBPAY ─────────────────────────────────────────── */
.mock-webpay { min-height: calc(100vh - 120px); display: flex; align-items: center; justify-content: center; padding: 2rem; }
.mock-card { background: #fff; border: 2px dashed var(--gray-200); border-radius: var(--radius-xl); padding: 3rem; max-width: 480px; width: 100%; text-align: center; }
.mock-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.mock-badge { background: #fef9c3; color: #a16207; font-size: .75rem; padding: .3rem .8rem; border-radius: var(--radius-full); font-weight: 600; }
.mock-desc { color: var(--gray-500); font-size: .9rem; margin-bottom: 1.5rem; line-height: 1.6; }
.mock-token { font-size: .8rem; color: var(--gray-400); margin-bottom: 2rem; background: var(--gray-50); padding: .6rem 1rem; border-radius: var(--radius-md); }
.mock-token code { color: var(--blue-600); font-weight: 600; }
.mock-actions { display: flex; flex-direction: column; gap: .8rem; }

/* ── FOOTER ──────────────────────────────────────────────── */
.footer { background: var(--gray-900); padding: 2.5rem 2rem; text-align: center; }
.footer-inner p { color: var(--gray-400); font-size: .85rem; }
.footer-sub { font-size: .75rem; margin-top: .3rem; }
.footer a { color: var(--gray-400); text-decoration: none; }

/* ── TEXT HELPERS ────────────────────────────────────────── */
.text-danger { color: var(--red-600); }
.hidden { display: none !important; }

/* ── PRINT ───────────────────────────────────────────────── */
@media print {
  .nav, .footer, .result-actions, .btn-primary, .btn-outline { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links a { display: none; }
  .hero { padding: 3rem 1.5rem; }
  .hero-title { font-size: 2rem; }
  .hero-trust { gap: 1rem; }
  .dp-body { grid-template-columns: 1fr; }
  .dp-sidebar { display: none; }
  .section { padding: 3rem 1.5rem; }
  .checkout-page { padding: 1.5rem 1rem; }
}
