/* ============================================================
   TU PRIMER EMPLEO — Main Stylesheet
   Mobile-first | BEM-inspired | CSS Custom Properties
   ============================================================ */

/* ── Variables ───────────────────────────────────────────────── */
:root {
  --green:        #4CAF50;
  --green-dark:   #43A047;
  --green-mid:    #81C784;
  --green-soft:   #A5D6A7;
  --bg:           #FFFFFF;
  --bg-alt:       #F5F9F5;
  --text:         #2E3A2E;
  --text-muted:   #5E6D5E;
  --border:       #D8ECD8;
  --border-light: #EBF5EB;
  --danger:       #D32F2F;
  --danger-bg:    #FFEBEE;
  --success-bg:   #E8F5E9;
  --info-bg:      #E3F2FD;
  --info:         #1976D2;
  --radius:       8px;
  --radius-lg:    12px;
  --shadow-xs:    0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:    0 1px 4px rgba(0,0,0,.07);
  --shadow:       0 2px 8px rgba(0,0,0,.09);
  --t:            .2s ease;
  --font:         'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img  { max-width: 100%; display: block; }
a    { color: var(--green); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--green-dark); }
ul   { list-style: none; }

/* ── Typography ──────────────────────────────────────────────── */
h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); font-weight: 800; line-height: 1.2; color: var(--text); }
h2 { font-size: clamp(1.35rem, 4vw, 2rem);   font-weight: 700; line-height: 1.25; color: var(--text); }
h3 { font-size: clamp(1.05rem, 3vw, 1.3rem); font-weight: 700; line-height: 1.3; color: var(--text); }
p  { color: var(--text-muted); }

/* ── Layout ──────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.page-bg   { background: var(--bg-alt); flex: 1; padding: 2.5rem 0; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1.75rem; border-radius: var(--radius);
  font-size: 1rem; font-weight: 600; font-family: var(--font);
  border: 2px solid transparent; cursor: pointer;
  transition: background var(--t), border-color var(--t), color var(--t), transform var(--t);
  white-space: nowrap; line-height: 1; text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn-primary  { background: var(--green);  border-color: var(--green);  color: #fff; }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }

.btn-outline  { background: transparent; border-color: var(--green); color: var(--green); }
.btn-outline:hover { background: var(--green); color: #fff; }

.btn-ghost    { background: var(--bg-alt); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--border-light); color: var(--text); }

.btn-danger   { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b71c1c; border-color: #b71c1c; color: #fff; }

.btn-sm  { padding: .4rem .9rem; font-size: .8125rem; border-width: 1.5px; }
.btn-lg  { padding: .9rem 2.25rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ── Header / Nav ────────────────────────────────────────────── */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 200;
  box-shadow: var(--shadow-xs);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav__logo {
  font-size: 1.3rem; font-weight: 800; color: var(--green);
  letter-spacing: -.3px; text-decoration: none;
}
.nav__logo:hover { color: var(--green-dark); text-decoration: none; }
.nav__menu { display: flex; align-items: center; gap: 1.5rem; }
.nav__menu a { color: var(--text); font-weight: 500; font-size: .9375rem; }
.nav__menu a:hover { color: var(--green); }
.nav__toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: .25rem;
}
.nav__toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: var(--t); }

/* ── Hero ────────────────────────────────────────────────────── */
.hero { background: var(--bg-alt); padding: 4.5rem 0 3.5rem; text-align: center; }
.hero__pill {
  display: inline-block; background: var(--success-bg); color: var(--green);
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px;
  padding: .35rem .875rem; border-radius: 999px; margin-bottom: 1.25rem;
}
.hero__title { margin-bottom: 1.25rem; }
.hero__title .hi { color: var(--green); }
.hero__subtitle { font-size: 1.1rem; color: var(--text-muted); max-width: 560px; margin: 0 auto 2.25rem; }
.hero__cta { margin-bottom: 2.75rem; }
.hero__badges { display: flex; flex-wrap: wrap; justify-content: center; gap: .625rem; }
.badge {
  display: inline-flex; align-items: center; gap: .375rem;
  background: var(--bg); border: 1px solid var(--border);
  padding: .375rem .875rem; border-radius: 999px;
  font-size: .8125rem; color: var(--text);
}
.badge__ok { color: var(--green); font-weight: 700; }

/* ── Sections ────────────────────────────────────────────────── */
.section      { padding: 4rem 0; }
.section--alt { background: var(--bg-alt); }

.section__label {
  display: block; color: var(--green); font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px; margin-bottom: .625rem;
  text-align: center;
}
.section__title { text-align: center; margin-bottom: .75rem; }
.section__sub   { text-align: center; color: var(--text-muted); font-size: 1rem; max-width: 520px; margin: 0 auto 2.75rem; }

/* ── Feature Cards ───────────────────────────────────────────── */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }
.feat-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.625rem 1.5rem;
  transition: border-color var(--t), box-shadow var(--t);
}
.feat-card:hover { border-color: var(--green-mid); box-shadow: var(--shadow-sm); }
.feat-card__icon {
  width: 48px; height: 48px; background: var(--bg-alt);
  border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: 1rem;
}
.feat-card__title { font-size: .9375rem; font-weight: 700; margin-bottom: .375rem; color: var(--text); }
.feat-card__text  { font-size: .875rem; color: var(--text-muted); line-height: 1.55; }

/* ── Steps ───────────────────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(195px, 1fr)); gap: 2rem; }
.step  { text-align: center; padding: 0 .5rem; }
.step__num {
  width: 56px; height: 56px; background: var(--green); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.375rem; font-weight: 800; margin: 0 auto 1.125rem;
}
.step__title { font-size: .9375rem; font-weight: 700; color: var(--text); margin-bottom: .375rem; }
.step__text  { font-size: .8125rem; color: var(--text-muted); }

/* ── CTA Banner ──────────────────────────────────────────────── */
.cta-bar { background: var(--green); padding: 3.5rem 0; text-align: center; }
.cta-bar__title { color: #fff; font-size: clamp(1.3rem, 4vw, 1.8rem); margin-bottom: .75rem; }
.cta-bar__text  { color: rgba(255,255,255,.85); font-size: 1rem; margin-bottom: 2rem; }
.cta-bar .btn-primary { background: #fff; border-color: #fff; color: var(--green); }
.cta-bar .btn-primary:hover { background: var(--bg-alt); border-color: var(--bg-alt); color: var(--green-dark); }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer { background: #1a2b1a; color: #7a9a7a; padding: 2.5rem 0 1.5rem; margin-top: auto; }
.footer-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 1.25rem; text-align: center; margin-bottom: 1.5rem;
}
.footer-logo  { font-size: 1.15rem; font-weight: 800; color: var(--green-soft); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1.5rem; }
.footer-links a { color: #7a9a7a; font-size: .875rem; transition: color var(--t); }
.footer-links a:hover { color: var(--green-soft); }
.footer-copy  { border-top: 1px solid rgba(255,255,255,.07); padding-top: 1.25rem; text-align: center; font-size: .8rem; color: #4d6b4d; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-wrap  { max-width: 720px; margin: 0 auto; }
.form-wrap--sm { max-width: 440px; }
.form-card  {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2.25rem 2rem;
  box-shadow: var(--shadow-xs);
}
.form-head  { margin-bottom: 1.75rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border-light); }
.form-head__title { margin-bottom: .375rem; }
.form-head__sub   { color: var(--text-muted); font-size: .9375rem; }

.form-section        { margin-bottom: 1.75rem; padding-bottom: 1.75rem; border-bottom: 1px solid var(--border-light); }
.form-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.form-section__label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--text-muted); margin-bottom: 1rem; display: block;
}
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 1.125rem; }
.form-group { margin-bottom: 1.125rem; }
.form-group:last-child { margin-bottom: 0; }

.form-group label { display: block; font-size: .875rem; font-weight: 600; color: var(--text); margin-bottom: .4rem; }
.form-group label .req { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%; padding: .6875rem .875rem;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: .9375rem; color: var(--text); background: var(--bg);
  font-family: var(--font);
  transition: border-color var(--t), box-shadow var(--t);
  appearance: none; -webkit-appearance: none;
}
.form-control:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(76,175,80,.12); }
.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(211,47,47,.12); }
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%235E6D5E' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .875rem center; padding-right: 2.25rem;
}
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }
.field-error { font-size: .78rem; color: var(--danger); margin-top: .3rem; display: none; }
.is-invalid ~ .field-error,
.is-invalid + .field-error { display: block; }

/* File drop zone */
.file-drop {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 1.875rem 1.25rem; text-align: center; cursor: pointer; position: relative;
  transition: border-color var(--t), background var(--t);
}
.file-drop:hover, .file-drop.drag-over { border-color: var(--green); background: var(--bg-alt); }
.file-drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.file-drop__icon  { font-size: 2rem; margin-bottom: .5rem; }
.file-drop__label { font-weight: 600; font-size: .9375rem; color: var(--text); margin-bottom: .25rem; }
.file-drop__hint  { font-size: .8rem; color: var(--text-muted); }
.file-drop__name  { font-size: .875rem; color: var(--green); font-weight: 600; margin-top: .625rem; }

/* Alerts */
.alert {
  padding: .9375rem 1.125rem; border-radius: var(--radius);
  margin-bottom: 1.25rem; font-size: .9375rem; line-height: 1.5;
  display: flex; align-items: flex-start; gap: .75rem;
}
.alert-success { background: var(--success-bg); border-left: 4px solid var(--green); color: var(--text); }
.alert-error   { background: var(--danger-bg);  border-left: 4px solid var(--danger); color: var(--text); }
.alert-info    { background: var(--info-bg);    border-left: 4px solid var(--info);   color: var(--text); }

/* Password strength */
.pw-strength-wrap { margin-top: .5rem; }
.pw-strength-bar  { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.pw-strength-fill { height: 100%; width: 0; border-radius: 2px; transition: width .3s, background .3s; }
.pw-strength-label { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; }

/* ── Gracias ─────────────────────────────────────────────────── */
.gracias { text-align: center; padding: 4.5rem 0; }
.gracias__circle {
  width: 80px; height: 80px; background: var(--success-bg); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.25rem; margin: 0 auto 1.5rem;
}
.gracias__title { margin-bottom: 1rem; }
.gracias__text  { font-size: 1.05rem; color: var(--text-muted); max-width: 500px; margin: 0 auto 2rem; }
.gracias__box {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  max-width: 400px; margin: 0 auto 2rem; text-align: left;
}
.gracias__box-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); margin-bottom: 1rem; }
.gracias__row       { display: flex; gap: .75rem; margin-bottom: .75rem; font-size: .9rem; }
.gracias__row:last-child { margin-bottom: 0; }
.gracias__row strong { color: var(--text); min-width: 75px; flex-shrink: 0; }

/* ── Admin Layout ────────────────────────────────────────────── */
.admin-wrap { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px; background: #18281a; flex-shrink: 0;
  position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto;
  display: flex; flex-direction: column;
}
.sidebar__brand { padding: 1.375rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar__brand a { color: var(--green-soft); font-weight: 800; font-size: .9375rem; text-decoration: none; }
.sidebar__brand span { display: block; font-size: .7rem; color: #4d6d4d; font-weight: 400; margin-top: 2px; }
.sidebar__section { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #3d5e3d; padding: 1.25rem 1.25rem .4rem; }
.sidebar__nav a {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1.25rem; color: #7a9a7a; font-size: .875rem;
  transition: background var(--t), color var(--t); text-decoration: none;
}
.sidebar__nav a:hover,
.sidebar__nav a.active { background: rgba(76,175,80,.12); color: var(--green-soft); }
.sidebar__nav .nav-ico { font-size: 1rem; opacity: .85; }
.sidebar__footer { margin-top: auto; padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.06); }
.sidebar__footer a { color: #4d6d4d; font-size: .8125rem; transition: color var(--t); text-decoration: none; }
.sidebar__footer a:hover { color: #7a9a7a; }

.admin-body { margin-left: 240px; flex: 1; display: flex; flex-direction: column; background: var(--bg-alt); min-height: 100vh; }

.topbar {
  background: var(--bg); border-bottom: 1px solid var(--border);
  padding: .875rem 2rem; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-xs);
}
.topbar__title { font-weight: 700; font-size: .9375rem; }
.topbar__user  { font-size: .8125rem; color: var(--text-muted); display: flex; align-items: center; gap: 1rem; }

.admin-content { padding: 2rem; flex: 1; }

/* Stats */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1.125rem; margin-bottom: 2rem; }
.stat-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.375rem 1.5rem; }
.stat-card__label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); margin-bottom: .5rem; }
.stat-card__value { font-size: 2.125rem; font-weight: 800; color: var(--green); line-height: 1; }
.stat-card__sub   { font-size: .75rem; color: var(--text-muted); margin-top: .375rem; }

/* Table card */
.table-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 1.5rem; }
.table-card__head {
  padding: 1.125rem 1.5rem; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.table-card__head h3 { font-size: .9375rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table thead th {
  background: var(--bg-alt); padding: .6875rem 1rem; text-align: left;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table tbody td { padding: .875rem 1rem; border-bottom: 1px solid var(--border-light); vertical-align: middle; color: var(--text); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--bg-alt); }
.td-actions { display: flex; gap: .375rem; flex-wrap: wrap; }

/* Filter bar */
.filter-bar {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.125rem 1.5rem;
  margin-bottom: 1.5rem; display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end;
}
.filter-bar .form-control { flex: 1; min-width: 140px; }
.filter-bar__actions { display: flex; gap: .5rem; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: .375rem; padding: 1.125rem; }
.page-btn {
  padding: .4375rem .8125rem; border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: .8125rem;
  background: var(--bg); transition: all var(--t); text-decoration: none;
}
.page-btn:hover, .page-btn.active { background: var(--green); color: #fff; border-color: var(--green); }

/* Chip */
.chip { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.chip-green  { background: var(--success-bg); color: #2e7d32; }
.chip-blue   { background: var(--info-bg);    color: #1565c0; }
.chip-orange { background: #fff3e0;            color: #e65100; }

/* Candidate detail */
.cand-head { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.75rem; margin-bottom: 1.5rem; display: flex; gap: 1.5rem; align-items: flex-start; }
.cand-avatar { width: 68px; height: 68px; background: var(--bg-alt); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.875rem; flex-shrink: 0; border: 2px solid var(--border); }
.cand-info__name { font-size: 1.35rem; font-weight: 800; margin-bottom: .375rem; }
.cand-info__meta { display: flex; flex-wrap: wrap; gap: .875rem; font-size: .8125rem; color: var(--text-muted); }
.cand-actions { margin-left: auto; display: flex; gap: .5rem; flex-shrink: 0; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.5rem; }
.detail-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; }
.detail-card__title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); margin-bottom: 1.125rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border-light); }
.detail-row { display: flex; gap: .75rem; margin-bottom: .75rem; font-size: .875rem; }
.detail-row:last-child { margin-bottom: 0; }
.detail-label { font-weight: 600; color: var(--text); min-width: 120px; flex-shrink: 0; }
.detail-value { color: var(--text-muted); }

/* Admin login */
.admin-login { min-height: 100vh; background: var(--bg-alt); display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }

/* ── Utilities ───────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.fw-700      { font-weight: 700; }
.fs-sm       { font-size: .875rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.d-flex { display: flex; }
.gap-1  { gap: .5rem; }
.gap-2  { gap: 1rem; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-100 { width: 100%; }

/* Spinner */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-radius: 50%; border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav__menu {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: flex-start;
    padding: .875rem 1.25rem; gap: .25rem; box-shadow: var(--shadow);
  }
  .nav__menu.open { display: flex; }
  .nav__menu a   { padding: .625rem 0; font-size: 1rem; width: 100%; }
  .nav__toggle   { display: flex; }

  .form-row    { grid-template-columns: 1fr; }
  .filter-bar  { flex-direction: column; }
  .detail-grid { grid-template-columns: 1fr; }
  .cand-head   { flex-direction: column; }
  .cand-actions { margin-left: 0; }

  .sidebar     { display: none; }
  .admin-body  { margin-left: 0; }
  .admin-content { padding: 1rem; }

  .hero { padding: 3rem 0 2.5rem; }
  .section { padding: 2.75rem 0; }
  .form-card { padding: 1.5rem 1.125rem; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .table-card { overflow-x: auto; }
}

@media (min-width: 769px) {
  .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}
