:root {
  --green-900: #0E3B2E;
  --green-700: #0E3B2E;
  --gold: #F2B200;
  --ink: #1A1A1A;
  --muted: #617083;
  --line: #d9e6df;
  --soft: #f7fbf8;
  --white: #FFFFFF;
  --shadow: 0 10px 28px rgba(15,61,37,.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
}

body.login-page {
  min-height: 100vh;
  background: #fff;
}

body:not(.login-page) {
  background:
    radial-gradient(circle at top left, rgba(14,59,46,.08), transparent 30%),
    radial-gradient(circle at top right, rgba(242,178,0,.08), transparent 26%),
    linear-gradient(180deg,#ffffff 0%,#f7fbf8 100%);
}

a { text-decoration: none; color: inherit; }

.portal-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 22px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

body:not(.login-page) .portal-header {
  box-shadow: 0 10px 24px rgba(15,61,37,.04);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1600px;
  margin: 0 auto;
}

.login-panel {
  min-height: 100vh;
  padding: 32px 36px;
}

.login-panel-brand {
  display: flex;
  align-items: center;
  background: var(--green-900);
  color: #fff;
}

.login-panel-access {
  background: #fff;
  display: grid;
  grid-template-rows: auto 1fr;
}

.login-brand-hero {
  width: min(520px, 100%);
  margin: auto;
  display: grid;
  gap: 14px;
}

.login-panel-brand h1 {
  font-size: clamp(42px, 4vw, 68px);
  line-height: .96;
  letter-spacing: -.055em;
  margin: 4px 0 0;
}

.login-panel-brand p {
  color: rgba(255,255,255,.84);
  font-size: 17px;
  max-width: 560px;
  line-height: 1.72;
}

.login-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.login-points span {
  display: inline-flex;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.14);
  font-size: 13px;
  font-weight: 800;
}

.login-visual {
  margin: 6px 0 0;
  display: grid;
  gap: 12px;
}

/* Reemplazo de imágenes rotas por fondos vectoriales decorativos CSS */
.login-visual-fallback, .page-hero-media-fallback {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.15);
  background: linear-gradient(135deg, #114c32 0%, #061f18 100%);
  box-shadow: 0 18px 42px rgba(0,0,0,.28);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-hero-media-fallback {
  max-height: 220px;
  background: linear-gradient(135deg, var(--green-900) 0%, #165c48 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.login-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 18px;
}

.login-workflow {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  width: min(720px, 100%);
  margin: auto;
}

.login-card-shell, .demo-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 14px 34px rgba(15,61,37,.06);
}

.login-card-shell { padding: 28px; }
.login-card-shell h2 {
  margin-top: 10px;
  font-size: clamp(28px, 3vw, 44px);
  letter-spacing: -.04em;
}

.login-subcopy { margin: 12px 0 0; color: var(--muted); }

.login-card {
  padding: 22px 0 0;
  display: grid;
  gap: 16px;
  align-content: start;
}

.login-card .btn-primary { width: 100%; }

.demo-panel {
  padding: 24px 28px;
  display: grid;
  gap: 14px;
  background: radial-gradient(circle at top right, rgba(242,178,0,.1), transparent 22%), #fff;
}

.eyebrow {
  display: inline-flex;
  width: max-content;
  border-radius: 999px;
  background: rgba(22,101,52,.09);
  color: var(--green-700);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.login-eyebrow { background: rgba(255,255,255,.12); color: #fff; }
.demo-eyebrow { background: rgba(14,59,46,.08); color: var(--green-900); }

.demo-panel h3 { font-size: 22px; line-height: 1.15; margin: 2px 0 0; }
.demo-selector { display: grid; gap: 8px; font-weight: 800; }
.demo-selector span { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

.demo-message {
  margin: 4px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(14,59,46,.08);
  background: rgba(14,59,46,.04);
  color: var(--green-900);
  font-weight: 700;
}

.demo-note { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

h1 { font-size: clamp(34px, 5vw, 64px); line-height: 1; margin: 16px 0; letter-spacing: -.045em; }
p { color: var(--muted); line-height: 1.68; }

.metric-grid, .panel-grid { display: grid; gap: 16px; }

body:not(.login-page) .metric-grid article,
body:not(.login-page) .panel-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

body:not(.login-page) .panel-card { padding: 24px; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 15px;
  font: inherit;
  background: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  font-weight: 900;
  cursor: pointer;
}

.btn-primary { background: var(--green-700); color: #fff; }
.btn-light { background: #fff; color: var(--green-900); border: 1px solid var(--line); }
.btn-large { padding: 15px 22px; }
.back-link { min-width: 240px; }
.forgot-link { display: inline-flex; justify-content: center; font-weight: 800; color: var(--green-700); margin-top: 8px; }
.note { font-size: 13px; margin: 0; text-align: center; color: var(--muted); }

body:not(.login-page) main { padding-bottom: 72px; }
.page-hero { padding: 52px 7vw 20px; }
.page-hero-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(260px,340px); gap: 18px; align-items: center; }
.page-hero-copy { display: grid; gap: 0; }
.page-hero-copy h1 { margin: 12px 0 10px; }
.page-hero-media { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; }
.page-hero-media figcaption { display: grid; gap: 2px; padding: 12px 16px 14px; background: #fff; }
.page-hero-media strong { color: var(--green-900); font-size: 15px; }
.page-hero-media span { color: var(--muted); font-size: 13px; line-height: 1.55; }

.metric-grid { grid-template-columns: repeat(4, 1fr); padding: 0 7vw 18px; }
.metric-grid article { padding: 22px; }
.metric-grid span { display: block; color: var(--muted); font-weight: 800; font-size: 13px; }
.metric-grid strong { font-size: 38px; color: var(--green-900); }

.panel-grid { grid-template-columns: repeat(2, 1fr); padding: 0 7vw 60px; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 12px 14px; text-align: left; }
th { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

@media(max-width:1000px){
  .login-shell { grid-template-columns: 1fr; }
  .login-panel { min-height: auto; padding: 28px 20px; }
  .login-panel-brand { min-height: 42vh; }
  .page-hero-layout, .metric-grid, .panel-grid { grid-template-columns: 1fr; }
  .login-topbar { justify-content: flex-start; }
}
@media(max-width:680px){
  .metric-grid, .panel-grid { padding-left: 20px; padding-right: 20px; }
  .page-hero { padding: 32px 20px 10px; }
}

/* JoathiVA fixes: navegación, assets e integridad visual */
.portal-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.portal-nav a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--green-900);
  font-size: 12px;
  font-weight: 900;
  background: #fff;
}

.session-widget {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 6px;
}

.session-copy {
  text-align: right;
  font-size: 13px;
}

.session-copy strong {
  display: block;
  color: var(--green-900);
}

.session-copy span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.btn-secondary {
  background: var(--gold);
  color: var(--green-900);
}

.btn-danger {
  padding: 7px 13px;
  font-size: 12px;
  background: #fff5f5;
  color: #cc3333;
  border: 1px solid #ffe0e0;
}

.page-hero-media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

@media(max-width:1000px){
  .portal-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .portal-nav,
  .session-widget {
    margin-left: 0;
  }
  .session-widget {
    width: 100%;
    justify-content: space-between;
  }
  .session-copy {
    text-align: left;
  }
}


/* Nuevas imágenes locales JoathiVA */
.login-visual-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: 0 18px 42px rgba(0,0,0,.28);
}

/* Access control notice */
.access-notice {
  max-width: min(1120px, calc(100% - 32px));
  margin: 24px auto 0;
  padding: 14px 18px;
  border: 1px solid rgba(242, 178, 0, .35);
  border-radius: 16px;
  background: rgba(242, 178, 0, .10);
  color: var(--green-900);
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(14, 59, 46, .08);
}

.portal-nav a.active {
  background: var(--green-900);
  color: #ffffff;
  border-color: var(--green-900);
}
