/* Mi cliente ideal - estilos */
:root {
  --bg: #F5F4EE;
  --bg-2: #ECEAE0;
  --surface: #FFFFFF;
  --surface-soft: #FAF8F3;
  --text: #1B2228;
  --muted: #6B7780;
  --border: #E3E0D6;
  --border-strong: #D2CFC2;
  --primary: #2B5C5E;
  --primary-hover: #1F4548;
  --primary-soft: #DCEBE9;
  --accent: #C66A3A;
  --accent-soft: #FBE7D4;
  --olive: #7B8C5C;
  --olive-soft: #E8ECD8;
  --gold: #C9A24D;
  --gold-soft: #F5E9C9;
  --rose: #B85C5C;
  --rose-soft: #F3D7D5;
  --danger: #B3413C;
  --soft: #EFEDE3;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 16px rgba(15,23,42,.05);
  --shadow-hover: 0 2px 8px rgba(15,23,42,.06), 0 14px 36px rgba(15,23,42,.08);
  --font: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { padding: 0; margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 100% -200px, rgba(198, 106, 58, 0.07), transparent 60%),
    radial-gradient(900px 500px at -200px 100%, rgba(43, 92, 94, 0.08), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; letter-spacing: -0.015em; font-weight: 700; }
h1 { font-size: 28px; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error-msg { color: var(--danger); font-size: 13px; margin: 6px 0; }
code { background: var(--soft); padding: 2px 6px; border-radius: 6px; font-size: 12.5px; }

/* nav */
.topnav {
  background: rgba(255,255,255,0.78);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topnav-inner {
  max-width: 1100px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 0 0 4px rgba(43,92,94,.12);
}
.nav-links { display: flex; gap: 18px; flex-wrap: wrap; }
.nav-links a { color: var(--muted); font-weight: 500; padding: 6px 2px; border-bottom: 2px solid transparent; transition: all .2s; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--primary); border-color: var(--primary); }

.container { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; width: 100%; flex: 1; }

/* card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s ease, transform .2s ease;
  margin-bottom: 16px;
}
a.card { color: inherit; }
a.card:hover, .profile-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); text-decoration: none; }
.card.empty { color: var(--muted); text-align: center; padding: 36px; }
.card.center { text-align: center; padding: 36px 24px; }

/* hero */
.hero {
  display: flex; justify-content: space-between; gap: 24px; align-items: center;
  background:
    radial-gradient(700px 240px at 110% 110%, rgba(198,106,58,.10), transparent 60%),
    linear-gradient(135deg, #ffffff 0%, var(--surface-soft) 100%);
  border-color: var(--border-strong);
  overflow: hidden; position: relative;
}
.hero::after {
  content: ''; position: absolute; right: -60px; top: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(43,92,94,.10), transparent);
  pointer-events: none;
}
.hero h1 { font-size: 32px; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .14em; }
.lead { color: var(--muted); max-width: 540px; margin-top: 8px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.hero-stat { text-align: right; position: relative; z-index: 1; }
.hero-cta { position: relative; z-index: 1; }
.btn-xl { padding: 16px 28px; font-size: 16px; border-radius: 14px; box-shadow: 0 6px 22px rgba(43,92,94,.25); }
.btn-xl:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(43,92,94,.32); }
.stat-number {
  font-size: 56px; font-weight: 800; line-height: 1;
  background: linear-gradient(135deg, var(--primary) 30%, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-label { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary); color: #fff;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--primary);
  font-weight: 600; font-size: 14px; cursor: pointer;
  transition: all .15s ease; text-decoration: none;
}
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(180deg, #336F71, var(--primary)); }
.btn-primary:hover { background: linear-gradient(180deg, #2B5C5E, var(--primary-hover)); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--soft); }
.btn-link { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.btn-link:hover { color: var(--primary-hover); }

.link { color: var(--primary); font-weight: 500; }

/* section */
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 14px; flex-wrap: wrap; }
.section { margin-top: 12px; }

/* grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }

/* profile card */
.profile-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; }
.profile-card-body { flex: 1; min-width: 0; }
.profile-card h3 { margin: 0 0 4px; font-size: 16px; }
.profile-card .excerpt { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.avatar-wrap {
  width: 64px; height: 64px; border-radius: 50%;
  background-color: var(--soft);
  background-size: cover; background-position: center;
  flex-shrink: 0; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), 0 2px 6px rgba(15,23,42,.10);
  transition: transform .2s ease, box-shadow .2s ease;
}
.profile-card:hover .avatar-wrap { transform: scale(1.04); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), 0 4px 14px rgba(15,23,42,.16); }
.avatar-wrap.large { width: 96px; height: 96px; }
.avatar-wrap.no-flag {
  background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft));
}
.avatar-fallback {
  font-size: 26px; opacity: .55;
}
.avatar-wrap.large .avatar-fallback { font-size: 40px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* badge */
.badge { font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.badge-borrador { background: var(--gold-soft); color: #8a6614; }
.badge-aprobado { background: var(--olive-soft); color: #4d6235; }
.badge-archivado { background: var(--rose-soft); color: #7d3a3a; }
.badge-en\.revisión, [class~="badge-en\ revisión"] { background: var(--primary-soft); color: var(--primary); }

/* section card with badge letter */
.section-card { position: relative; }
.section-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.section-card-header h2 { margin: 0; }
.section-card-header p { width: 100%; color: var(--muted); margin: 0; font-size: 13px; }
.section-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #3F7779);
  color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: 0 2px 6px rgba(43,92,94,.2);
}

/* form */
.form-wrap { max-width: 720px; margin: 0 auto; }
.form-card { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field-label { display: flex; align-items: center; gap: 6px; }
.field label { font-weight: 600; font-size: 13.5px; color: var(--text); }
.field .req { color: var(--accent); margin-left: 4px; }
.field input[type=text], .field input[type=number], .field input[type=password], .field input[type=email],
.field select, .field textarea, .country-picker [data-country-search] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); font: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input:focus, .field select:focus, .field textarea:focus, .country-picker [data-country-search]:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(43,92,94,.18);
  background: #fff;
}
.field textarea { resize: vertical; min-height: 70px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.actions.vertical { flex-direction: column; align-items: stretch; margin-top: 12px; }

/* tooltip button */
.tooltip-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  border: 0; cursor: pointer; font-size: 11px; font-weight: 700;
  padding: 0; line-height: 1; transition: all .15s;
}
.tooltip-btn:hover, .tooltip-btn:focus { background: var(--primary); color: #fff; outline: none; transform: scale(1.08); }
.tooltip-pop {
  position: absolute; z-index: 200;
  background: #1B2228; color: #fff; padding: 8px 12px;
  border-radius: 10px; font-size: 12.5px; max-width: 260px; line-height: 1.45;
  box-shadow: var(--shadow-hover);
  animation: pop .15s ease both;
}
.tooltip-pop::before {
  content: ''; position: absolute; left: 12px; top: -5px;
  width: 10px; height: 10px; background: #1B2228; transform: rotate(45deg);
}
@keyframes pop { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }

/* country picker */
.country-picker { position: relative; }
.country-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover); max-height: 320px; overflow-y: auto; z-index: 30;
}
.country-result {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer;
  font-size: 14px; transition: background .12s;
}
.country-result:hover { background: var(--primary-soft); }
.country-result .flag { font-size: 18px; line-height: 1; }
.country-result .cname { flex: 1; }
.country-result .ccode { color: var(--muted); font-size: 12px; letter-spacing: .04em; }

/* edit layout */
.layout-edit { display: grid; grid-template-columns: 250px 1fr; gap: 20px; align-items: flex-start; }
.sticky { position: sticky; top: 80px; }
.side h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.section-nav { list-style: none; padding: 0; margin: 14px 0 0; }
.section-nav li a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--text); font-size: 13.5px; font-weight: 500; }
.section-nav li a:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.progress { background: var(--soft); height: 6px; border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress-bar { background: linear-gradient(90deg, var(--primary), var(--accent)); height: 100%; transition: width .3s ease; }
.form-body { display: flex; flex-direction: column; gap: 18px; }
.questions { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.edit-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.save-indicator {
  font-size: 13px; color: var(--olive); padding: 6px 14px; border-radius: 999px;
  background: var(--olive-soft); font-weight: 500;
  transition: opacity .2s ease;
}
.save-indicator.saving { color: var(--muted); background: var(--soft); }
.save-indicator.error { color: var(--danger); background: var(--rose-soft); }

/* chips / tags / scale */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: #fff; border: 1px solid var(--border-strong); color: var(--text);
  padding: 6px 12px; border-radius: 999px; font-size: 13px; cursor: pointer;
  transition: all .15s;
}
.chip:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.chip.selected {
  background: linear-gradient(135deg, var(--primary), #3F7779);
  color: #fff; border-color: var(--primary);
  box-shadow: 0 2px 4px rgba(43,92,94,.18);
}

.tags-input { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; }
.tags-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: var(--olive-soft); color: #4d6235; padding: 4px 10px; border-radius: 999px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.tag-x { border: 0; background: none; cursor: pointer; color: inherit; font-size: 16px; padding: 0; line-height: 1; }
.tags-input input { border: 0; outline: none; padding: 4px; font: inherit; min-width: 100px; flex: 1; }

.scale { display: flex; gap: 8px; }
.scale-dot {
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border-strong);
  cursor: pointer; font-weight: 600; color: var(--muted);
  transition: all .15s;
}
.scale-dot:hover { border-color: var(--primary); color: var(--primary); }
.scale-dot.selected {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; border-color: transparent;
  transform: scale(1.05);
}

/* switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.slider {
  width: 40px; height: 22px; background: #d6dadd; border-radius: 999px; position: relative;
  transition: background .2s;
}
.slider::after {
  content: ''; position: absolute; left: 3px; top: 3px;
  width: 16px; height: 16px; background: #fff; border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::after { transform: translateX(18px); }
.switch-label { font-size: 13px; color: var(--muted); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 18px 0 16px; overflow-x: auto; }
.tab { background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-color: var(--primary); }

/* textarea big */
.big-text { width: 100%; padding: 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; resize: vertical; line-height: 1.6; }
.summary-textarea { min-height: 520px; font-size: 14.5px; }
@media (max-width: 800px) { .summary-textarea { min-height: 380px; } }
.big-text:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(43,92,94,.15); }
.big-text.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; }
.code { background: var(--soft); padding: 14px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 12.5px; }

/* table */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.table tr:last-child td { border-bottom: 0; }

/* answers list */
.answers-list { display: grid; grid-template-columns: 1fr 2fr; gap: 8px 16px; margin: 0; }
.answers-list dt { color: var(--muted); font-size: 13px; }
.answers-list dd { margin: 0; }

/* profile header */
.profile-header { display: flex; gap: 18px; align-items: flex-start; }
.profile-meta { flex: 1; min-width: 0; }

/* footer */
.footer { border-top: 1px solid var(--border); background: rgba(255,255,255,.5); margin-top: 40px; }
.footer-inner {
  max-width: 1100px; margin: 0 auto; padding: 14px 20px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 13px;
}
.admin-link { font-size: 13px; color: var(--muted) !important; text-decoration: none; }
.admin-link::before { content: '⚙ '; }
.admin-link:hover { color: var(--primary) !important; }
.admin-tag { display: inline-flex; align-items: center; gap: 12px; font-size: 13px; }
.admin-tag .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--olive); display: inline-block; }

.lock-icon { font-size: 32px; margin-bottom: 10px; }

/* toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 100;
  box-shadow: var(--shadow-hover);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* animations */
.fade-in { animation: fadeIn .4s ease both; }
.fade-in-delay { animation: fadeIn .5s ease both .08s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.card { animation: fadeIn .35s ease both; }

/* responsive */
@media (max-width: 800px) {
  .layout-edit { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .hero { flex-direction: column; align-items: flex-start; }
  .hero-stat { text-align: left; }
  h1 { font-size: 24px; }
  .topnav-inner { gap: 8px; }
  .nav-links { gap: 12px; }
  .container { padding: 20px 14px 40px; }
  .card { padding: 18px; }
  .questions { grid-template-columns: 1fr; }
  .tooltip-pop { max-width: 220px; font-size: 12px; }
}
