:root {
  --brand: #0ea5e9;
  --brand-600: #0284c7;
  --ink: #0f172a;
  --muted: #64748b;
  --soft: #f8fafc;
  --surface: #ffffff;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --shadow-soft: 0 20px 45px -25px rgba(15, 23, 42, 0.35);
}

body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color: var(--ink);
  background: #eef2f6;
}

.bg-soft {
  background: var(--soft);
}

.page-shell {
  padding: 1.25rem 0 2.25rem;
  background: var(--soft);
}

.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.page-subtitle {
  color: #475569;
  margin-bottom: 0;
}

.surface-card {
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  background: var(--surface);
}

.panel-soft {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  background: #f8fafc;
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  background: #fff;
  color: #1e293b;
  font-weight: 600;
  padding: 0.42rem 0.8rem;
}

.metric-chip strong {
  color: var(--brand-600);
}

.font-fraunces {
  font-family: "Fraunces", serif;
}

.brand-wordmark {
  font-family: "Fraunces", serif;
}

.navbar .nav-link {
  border-radius: 0.6rem;
  padding: 0.38rem 0.7rem;
}

.navbar .nav-link.active {
  color: var(--brand-600) !important;
  background: rgba(14, 165, 233, 0.12);
  font-weight: 600;
}

#appToastContainer {
  z-index: 1085;
}

.icon-circle-44 {
  width: 44px;
  height: 44px;
}

.auth-shell {
  padding: 1rem 0 2rem;
}

.auth-card {
  margin-top: 1.5rem;
}

.contract-scroll-frame {
  max-height: 600px;
  overflow-y: auto;
}

.contract-preview-zone {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 0.85rem;
  padding: 0.35rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.85);
}

.contract-iframe {
  display: block;
  min-height: 620px;
  background: #fff;
  border-radius: 0.65rem;
}

.field-compact {
  min-width: 220px;
  max-width: 320px;
}

.textarea-tall {
  min-height: 220px;
}

.max-w-700 {
  max-width: 700px;
}

.rounded-2xl {
  border-radius: var(--radius-2xl);
}

.hover-shadow {
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.hover-shadow:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px -24px rgba(15, 23, 42, 0.52);
}

body.landing-page {
  background: var(--surface);
}

body.admin-layout {
  background: #f1f5f9;
}

main {
  flex: 1 0 auto;
}

/* Evita doble margen cuando una vista define su propio .container dentro del base */
main > .container > .container {
  max-width: 100%;
  padding-right: 0;
  padding-left: 0;
}

footer {
  background: #0f172a;
  color: rgba(226, 232, 240, 0.88);
}

footer a {
  color: #38bdf8;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Footer rejuvenecido */
.site-footer {
  position: relative;
  overflow: hidden;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  padding: 3.5rem 0 2rem;
}

.site-footer::before,
.site-footer::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.28;
  z-index: 0;
}

.site-footer::before {
  background: #0ea5e9;
  top: -180px;
  left: -120px;
}

.site-footer::after {
  background: #38bdf8;
  bottom: -240px;
  right: -120px;
}

.site-footer .container {
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  align-items: start;
}

.footer-brand-title {
  font-family: "Fraunces", serif;
  font-size: 1.4rem;
  margin-bottom: 0.35rem;
  color: #e2e8f0;
}

.footer-description {
  font-size: 0.95rem;
  color: rgba(226, 232, 240, 0.78);
}

.footer-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-weight: 600;
  font-size: 0.82rem;
}

.footer-heading {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #e2e8f0;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0.85rem 0 0;
  display: grid;
  gap: 0.4rem;
}

.footer-link {
  color: rgba(226, 232, 240, 0.84);
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: color 0.2s ease, transform 0.2s ease;
}

.footer-link i {
  color: #38bdf8;
  font-size: 0.85rem;
}

.footer-link:hover {
  color: #f8fafc;
  transform: translateX(2px);
}

.footer-meta {
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  margin-top: 2.4rem;
  padding-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: space-between;
  font-size: 0.9rem;
  color: rgba(226, 232, 240, 0.78);
}

.footer-meta a {
  color: #a5b4fc;
}

.footer-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.footer-meta .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.12);
}

/* Páginas informativas */
.page-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(72px, 10vw, 128px) 0 72px;
  background: radial-gradient(circle at 20% 20%, rgba(14, 165, 233, 0.16), transparent 32%),
    radial-gradient(circle at 80% 0%, rgba(34, 197, 94, 0.1), transparent 26%),
    linear-gradient(180deg, #0f172a, #0b1323);
  color: #e2e8f0;
}

.page-hero h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 2.6vw + 1rem, 3rem);
}

.page-hero p.lead {
  max-width: 760px;
  color: rgba(226, 232, 240, 0.78);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.page-section {
  padding: clamp(48px, 7vw, 88px) 0;
}

.section-title {
  font-weight: 700;
  letter-spacing: -0.2px;
  color: #0f172a;
}

.section-lead {
  color: #475569;
  max-width: 820px;
}

.section-card {
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 1.5rem;
  height: 100%;
  box-shadow: 0 10px 35px -25px rgba(15, 23, 42, 0.45);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.section-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 45px -25px rgba(15, 23, 42, 0.55);
}

.icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 10px 30px -18px rgba(14, 165, 233, 0.75);
}

.icon-badge.success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 10px 30px -18px rgba(34, 197, 94, 0.7);
}

.icon-badge.purple {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  box-shadow: 0 10px 30px -18px rgba(168, 85, 247, 0.7);
}

.list-check {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
  color: #0f172a;
}

.list-check li {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  color: #334155;
}

.list-check i {
  color: #22c55e;
}

.muted-label {
  text-transform: uppercase;
  letter-spacing: 0.25px;
  font-weight: 700;
  font-size: 0.85rem;
  color: #475569;
}

.pill-note {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border-radius: 12px;
  background: rgba(14, 165, 233, 0.12);
  color: #0369a1;
  font-weight: 600;
}

.card,
.shadow-surface {
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 1rem;
  box-shadow: 0 20px 45px -25px rgba(15, 23, 42, 0.35);
  background-color: var(--surface);
}

.card-header:first-child {
  border-radius: 1rem 1rem 0 0;
}

.card-footer:last-child {
  border-radius: 0 0 1rem 1rem;
}

.btn-brand {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-600);
  --bs-btn-hover-border-color: var(--brand-600);
  --bs-btn-color: #fff;
}

.badge-warning,
.badge-success,
.badge-danger,
.badge-secondary {
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-weight: 600;
}

.badge-warning {
  background-color: #facc15;
  color: #854d0e;
}

.badge-success {
  background-color: #22c55e;
  color: #064e3b;
}

.badge-danger {
  background-color: #ef4444;
  color: #7f1d1d;
}

.badge-secondary {
  background-color: #cbd5f5;
  color: #312e81;
}

.btn-block {
  width: 100%;
}

.font-weight-bold {
  font-weight: 600 !important;
}

.font-weight-light {
  font-weight: 300 !important;
}

.ml-auto {
  margin-left: auto !important;
}

.mr-auto {
  margin-right: auto !important;
}

.ml-1 {
  margin-left: 0.25rem !important;
}

.ml-2 {
  margin-left: 0.5rem !important;
}

.mr-1 {
  margin-right: 0.25rem !important;
}

.mr-2 {
  margin-right: 0.5rem !important;
}

.border-left-primary {
  border-left: 4px solid var(--brand);
}

.border-left-success {
  border-left: 4px solid #22c55e;
}

.border-left-info {
  border-left: 4px solid #38bdf8;
}

.login-card-body {
  padding: 2rem;
}

.input-group-append {
  display: flex;
  align-items: center;
}

.input-group-append .input-group-text {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.admin-action-buttons {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
}

.admin-action-buttons > * {
  flex-shrink: 0;
}

.admin-action-buttons form {
  margin: 0;
}

@media (max-width: 767.98px) {
  .card,
  .shadow-surface {
    border-radius: 1rem;
  }
}

/* Home polish */
.home-account-alert {
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 0.9rem;
  box-shadow: 0 12px 26px -22px rgba(180, 83, 9, 0.5);
}

.home-plan-summary {
  border: 1px solid rgba(14, 165, 233, 0.16);
}

.home-plan-summary .small.text-muted.text-uppercase {
  letter-spacing: 0.45px;
  font-weight: 700;
}

.home-quick-actions .btn {
  min-width: 220px;
}

/* Contract actions polish */
.contract-actions-head {
  margin-bottom: 0.9rem;
}

.contract-actions-token-badge {
  border-color: rgba(14, 165, 233, 0.22) !important;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.95),
    rgba(248, 250, 252, 0.95)
  ) !important;
}

.contract-action-card {
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  border-radius: 1rem !important;
  box-shadow: 0 16px 30px -26px rgba(15, 23, 42, 0.5);
}

.contract-action-card h3 {
  letter-spacing: -0.1px;
}

.contract-action-card .badge {
  font-weight: 600;
}

.contract-action-card .form-text {
  line-height: 1.35;
}

@media (max-width: 767.98px) {
  .home-quick-actions .btn {
    min-width: 0;
    width: 100%;
  }

  .contract-actions-token-badge {
    width: 100%;
    justify-content: center;
  }
}

/* Help center image consistency */
.help-guide-figure {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

.help-guide-image {
  width: 100%;
  height: clamp(220px, 38vw, 420px);
  object-fit: contain;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.22);
  padding: 0.5rem;
}
