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

:root {
  --primary: #1B3A5C;
  --primary-light: #2E86AB;
  --accent: #E8871E;
  --success: #2E7D32;
  --danger: #C62828;
  --gray: #666;
  --gray-light: #e0e0e0;
  --bg: #f5f6fa;
  --white: #fff;
  --radius: 6px;
  --shadow: 0 2px 8px rgba(0,0,0,.08);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: #222;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Header ── */
.header {
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 1.5rem;
}
.header-title { font-size: 1.1rem; font-weight: 600; white-space: nowrap; }
.header-nav { display: flex; gap: .25rem; flex: 1; overflow-x: auto; }
.header-nav a {
  color: rgba(255,255,255,.75);
  text-decoration: none;
  padding: .4rem .8rem;
  border-radius: var(--radius);
  font-size: .875rem;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.header-nav a:hover, .header-nav a.active {
  background: rgba(255,255,255,.15);
  color: var(--white);
}
.header-right { display: flex; align-items: center; gap: .75rem; white-space: nowrap; }
.header-right .btn-outline {
  color: var(--white);
  border-color: rgba(255,255,255,.5);
}
.header-right .btn-outline:hover {
  background: rgba(255,255,255,.15);
  color: var(--white);
}
.user-name { font-size: .85rem; opacity: .85; }

/* ── Content ── */
.content { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.card-title { font-size: 1.15rem; font-weight: 600; color: var(--primary); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: #15304d; }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover:not(:disabled) { background: #d07518; }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover:not(:disabled) { background: #256b29; }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover:not(:disabled) { background: #a12020; }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }
.btn-link { background: none; color: var(--primary-light); padding: 0; text-decoration: underline; }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: .3rem;
  color: #444;
}
.form-control {
  width: 100%;
  padding: .55rem .75rem;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: inherit;
  transition: border-color .15s;
}
.form-control:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(46,134,171,.15); }
textarea.form-control { min-height: 120px; resize: vertical; }
select.form-control { appearance: auto; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }
.form-inline { display: flex; gap: .5rem; align-items: flex-end; }
.form-inline .form-group { margin-bottom: 0; }

/* ── Tables ── */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--gray-light); }
th { font-weight: 600; color: var(--primary); background: #f8f9fc; font-size: .8rem; text-transform: uppercase; letter-spacing: .3px; }
tr:hover td { background: #f8f9fc; }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 10px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.badge-borrador { background: #e3f2fd; color: #1565c0; }
.badge-en-firma { background: #fff3e0; color: #e65100; }
.badge-firmada { background: #e8f5e9; color: #2e7d32; }
.badge-rechazada { background: #ffebee; color: #c62828; }
.badge-role { background: #f3e5f5; color: #6a1b9a; }
.badge-plan { background: #e0f2f1; color: #00695c; }

/* ── Login ── */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}
.login-card {
  background: var(--white);
  border-radius: 12px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.login-title {
  text-align: center;
  color: var(--primary);
  margin-bottom: .5rem;
  font-size: 1.4rem;
}
.login-subtitle {
  text-align: center;
  color: var(--gray);
  margin-bottom: 1.5rem;
  font-size: .9rem;
}
.otp-input {
  text-align: center;
  font-size: 1.8rem;
  letter-spacing: 10px;
  font-weight: 700;
  padding: .75rem;
}

/* ── Registro card wider ── */
.registro-card { max-width: 480px; }

/* ── Registro plan selector ── */
.registro-planes {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.registro-plan-option {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .75rem;
  border: 2px solid var(--gray-light);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.registro-plan-option:hover {
  border-color: var(--primary-light);
  background: #f8f9fc;
}
.registro-plan-option input[type="radio"] {
  margin: 0;
  accent-color: var(--primary);
}
.registro-plan-option:has(input:checked) {
  border-color: var(--primary);
  background: #eef4fa;
}
.registro-plan-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.registro-plan-info strong {
  font-size: .9rem;
  color: var(--primary);
}
.registro-plan-info span {
  font-size: .8rem;
  color: var(--gray);
}

/* ── Dashboard stats ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  border-left: 4px solid var(--primary);
}
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: .8rem; color: var(--gray); text-transform: uppercase; letter-spacing: .3px; }
.stat-card.accent { border-left-color: var(--accent); }
.stat-card.accent .stat-value { color: var(--accent); }
.stat-card.success { border-left-color: var(--success); }
.stat-card.success .stat-value { color: var(--success); }

/* ── Detail sections ── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}
.detail-item label { font-size: .75rem; color: var(--gray); text-transform: uppercase; }
.detail-item .value { font-size: 1rem; font-weight: 500; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
}
.modal {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  width: 95%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
}
.modal-title { font-size: 1.1rem; font-weight: 600; color: var(--primary); margin-bottom: 1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }

/* ── Toast ── */
.toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 300; display: flex; flex-direction: column; gap: .5rem; }
.toast {
  padding: .75rem 1.25rem;
  border-radius: var(--radius);
  color: var(--white);
  font-size: .875rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  animation: slideIn .25s ease;
  max-width: 380px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary-light); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Tabs ── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--gray-light); margin-bottom: 1rem; }
.tab {
  padding: .6rem 1.2rem;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 500;
  color: var(--gray);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray);
}
.empty-state .icon { font-size: 2.5rem; margin-bottom: .75rem; }
.empty-state p { font-size: .95rem; }

/* ── Utilities ── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* ── Editor ── */
.editor-wrapper { border: 1px solid var(--gray-light); border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; }
.editor-wrapper .jodit-container { border: none !important; }
.acta-content { background: #f8f9fc; padding: 1.5rem; border-radius: var(--radius); font-size: .95rem; line-height: 1.7; }
.acta-content table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
.acta-content table td, .acta-content table th { border: 1px solid var(--gray-light); padding: .5rem .75rem; }
.acta-pdf-viewer { width: 100%; height: 600px; border: 1px solid var(--gray-light); border-radius: var(--radius); }

/* ── Opciones de creación ── */
.metodo-opciones { display: flex; flex-direction: column; gap: .5rem; }
.metodo-opcion {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem; border: 2px solid var(--gray-light); border-radius: var(--radius);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.metodo-opcion:hover { border-color: var(--primary-light); background: #f8f9fc; }
.metodo-opcion input[type="radio"] { margin: 0; accent-color: var(--primary); }
.metodo-opcion input[type="radio"]:checked ~ span strong { color: var(--primary); }
.metodo-opcion span { line-height: 1.3; }
.metodo-opcion small { color: var(--gray); font-size: .8rem; }

/* ── Landing page ── */
.landing-full { max-width: none; padding: 0; }

.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(27, 58, 92, .95);
  backdrop-filter: blur(8px);
}
.landing-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.5rem;
}
.landing-logo {
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 600;
}
.landing-nav-actions { display: flex; gap: .5rem; }
.landing-btn-outline {
  border: 1px solid rgba(255,255,255,.5);
  color: var(--white);
}
.landing-btn-outline:hover { background: rgba(255,255,255,.1); }

.landing-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  text-align: center;
  padding: 7rem 1.5rem 4rem;
}
.landing-hero-title {
  font-size: 2.4rem;
  font-weight: 700;
  max-width: 700px;
  margin: 0 auto 1rem;
  line-height: 1.2;
}
.landing-hero-subtitle {
  font-size: 1.1rem;
  opacity: .85;
  max-width: 550px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}
.landing-hero-cta {
  padding: .75rem 2rem;
  font-size: 1rem;
}

.landing-section-title {
  text-align: center;
  font-size: 1.6rem;
  color: var(--primary);
  margin-bottom: 2rem;
}

.landing-features {
  padding: 4rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.landing-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
}
.landing-feature-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  text-align: center;
}
.landing-feature-icon { font-size: 2.2rem; margin-bottom: .75rem; }
.landing-feature-card h3 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: .5rem;
}
.landing-feature-card p {
  font-size: .875rem;
  color: var(--gray);
  line-height: 1.5;
}

.landing-steps {
  padding: 4rem 1.5rem;
  background: #f0f2f8;
  max-width: none;
}
.landing-steps-grid {
  display: flex;
  justify-content: center;
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}
.landing-step {
  text-align: center;
  flex: 1;
  max-width: 280px;
}
.landing-step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-size: 1.3rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .75rem;
}
.landing-step h3 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: .5rem;
}
.landing-step p {
  font-size: .875rem;
  color: var(--gray);
  line-height: 1.5;
}

/* ── Landing pricing ── */
.landing-pricing {
  padding: 4rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.landing-pricing-subtitle {
  text-align: center;
  color: var(--gray);
  margin-top: -1rem;
  margin-bottom: 2.5rem;
  font-size: .95rem;
}
.landing-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.landing-pricing-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 2rem 1.5rem;
  text-align: center;
  position: relative;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
}
.landing-pricing-card.featured {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(232, 135, 30, .2);
}
.landing-pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--white);
  font-size: .75rem;
  font-weight: 600;
  padding: .2rem .8rem;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.landing-pricing-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: .5rem;
}
.landing-pricing-price {
  font-size: 2rem;
  font-weight: 700;
  color: #222;
  margin-bottom: .25rem;
}
.landing-pricing-period {
  font-size: .8rem;
  color: var(--gray);
  margin-bottom: 1.5rem;
  min-height: 1.2em;
}
.landing-pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  flex: 1;
}
.landing-pricing-features li {
  padding: .4rem 0;
  font-size: .875rem;
  color: #444;
  border-bottom: 1px solid #f0f0f0;
}
.landing-pricing-features li:last-child { border-bottom: none; }
.landing-pricing-btn {
  width: 100%;
  justify-content: center;
}
.landing-pricing-card .btn-outline {
  color: var(--primary);
  border-color: var(--primary);
}
.landing-pricing-card .btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

.landing-cta {
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--primary);
  color: var(--white);
}
.landing-cta h2 {
  font-size: 1.6rem;
  margin-bottom: .5rem;
}
.landing-cta p {
  opacity: .8;
  margin-bottom: 1.5rem;
}

/* ── Landing FEA link in pricing ── */
.landing-fea-link {
  color: var(--primary-light);
  text-decoration: underline;
  cursor: pointer;
  transition: color .15s;
}
.landing-fea-link:hover { color: var(--primary); }

/* ── Certificados page ── */
.cert-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  text-align: center;
  padding: 7rem 1.5rem 3rem;
}
.cert-hero-title {
  font-size: 2rem;
  font-weight: 700;
  max-width: 700px;
  margin: 0 auto 1rem;
  line-height: 1.2;
}
.cert-hero-subtitle {
  font-size: 1.05rem;
  opacity: .85;
  max-width: 550px;
  margin: 0 auto;
  line-height: 1.6;
}
.cert-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.cert-notice {
  display: flex;
  gap: 1rem;
  background: #fff3e0;
  border: 1px solid #ffe0b2;
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
}
.cert-notice-icon { font-size: 1.8rem; flex-shrink: 0; }
.cert-notice h3 {
  font-size: 1.05rem;
  color: #e65100;
  margin-bottom: .5rem;
}
.cert-notice p {
  font-size: .9rem;
  color: #444;
  line-height: 1.6;
}
.cert-section {
  margin-bottom: 2.5rem;
}
.cert-section h2 {
  font-size: 1.3rem;
  color: var(--primary);
  margin-bottom: 1rem;
}
.cert-section p {
  font-size: .925rem;
  color: #444;
  line-height: 1.7;
  margin-bottom: .75rem;
}
.cert-section ul {
  list-style: none;
  padding: 0;
  margin: .75rem 0 1rem;
}
.cert-section ul li {
  padding: .4rem 0 .4rem 1.5rem;
  position: relative;
  font-size: .9rem;
  color: #444;
  line-height: 1.6;
}
.cert-section ul li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}
.cert-providers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}
.cert-provider-card {
  background: var(--white);
  border: 2px solid var(--gray-light);
  border-radius: 12px;
  padding: 1.5rem;
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}
.cert-provider-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 4px 16px rgba(46,134,171,.15);
}
.cert-provider-card h3 {
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: .5rem;
}
.cert-provider-card p {
  font-size: .85rem;
  color: var(--gray);
  line-height: 1.5;
  margin-bottom: .75rem;
}
.cert-provider-link {
  font-size: .85rem;
  color: var(--primary-light);
  font-weight: 500;
}

.landing-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: .8rem;
  color: var(--gray);
  background: var(--bg);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .header { padding: 0 .75rem; gap: .75rem; }
  .header-nav { display: none; }
  .content { padding: 1rem; }
  .form-row { flex-direction: column; gap: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .landing-hero-title { font-size: 1.6rem; }
  .landing-hero { padding: 5.5rem 1rem 3rem; }
  .landing-steps-grid { flex-direction: column; align-items: center; }
  .landing-pricing-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .landing-pricing-grid { grid-template-columns: 1fr; }
}
