/* ============================================================
   SomosNODIA — Estilos compartidos del Portal (Clientes / Marcas / Comisionistas)
   Paleta extraída del sitio principal somosnodia.cl
   ============================================================ */

:root {
  --navy: #1A2332;
  --navy-dark: #111927;
  --navy-light: #2D3E50;
  --teal: #00A693;
  --teal-dark: #008F7E;
  --teal-light: #E0F5F1;
  --teal-glow: rgba(59, 181, 166, 0.15);
  --bg: #FAFBFC;
  --white: #FFFFFF;
  --text: #2D3E50;
  --text-light: #6B7F94;
  --border: #E2E8F0;
  --warm-bg: #FFF9F5;
  --shadow: 0 4px 24px rgba(45, 62, 80, 0.08);
  --shadow-lg: 0 12px 40px rgba(45, 62, 80, 0.12);
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; display: block; }

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.portal-header .logo img { height: 48px; }

.portal-header .back-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 6px;
}
.portal-header .back-link:hover { color: var(--teal-dark); }

.portal-header .session-info {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--text-light);
}

.portal-header .logout-btn {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--navy);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.portal-header .logout-btn:hover { border-color: var(--teal); color: var(--teal-dark); }

.portal-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.portal-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 700;
  color: var(--teal-dark);
  margin: 0 0 8px;
}

.portal-title {
  font-size: 30px;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 8px;
}

.portal-subtitle {
  font-size: 15px;
  color: var(--text-light);
  margin: 0 0 36px;
  max-width: 640px;
}

.section-block {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}

.section-block h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 4px;
}

.section-block .section-desc {
  font-size: 13.5px;
  color: var(--text-light);
  margin: 0 0 20px;
}

.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.price-folder { border: 1px solid var(--border); border-radius: 12px; margin-top: 14px; overflow: hidden; }
.price-folder summary { cursor: pointer; list-style: none; padding: 14px 16px; font-weight: 600; color: var(--text); background: var(--bg); display: flex; align-items: center; gap: 8px; }
.price-folder summary::-webkit-details-marker { display: none; }
.price-folder[open] summary { border-bottom: 1px solid var(--border); }
.price-folder .file-list { padding: 14px 16px; margin: 0; }

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  transition: border-color .15s, transform .15s;
}
.file-item:hover { border-color: var(--teal); transform: translateY(-1px); }

.file-item .file-meta { display: flex; align-items: center; gap: 12px; min-width: 0; }
.file-item .file-icon {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--teal-light);
  color: var(--teal-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.file-item .file-text { min-width: 0; }
.file-item .file-name { font-weight: 700; font-size: 14px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item .file-sub { font-size: 12.5px; color: var(--text-light); }

.file-item .file-actions { display: flex; gap: 8px; flex-shrink: 0; }

.file-item .file-action {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--teal-dark);
  background: var(--teal-light);
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.file-item .file-action:hover { background: var(--teal); color: var(--white); }

.file-item .file-action-secondary {
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--border);
}
.file-item .file-action-secondary:hover { background: var(--white); border-color: var(--teal); color: var(--teal-dark); }

.new-badge {
  font-size: 10.5px;
  font-weight: 800;
  background: var(--navy);
  color: var(--white);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: .04em;
  margin-left: 8px;
}

.featured-badge {
  font-size: 10.5px;
  font-weight: 800;
  background: #FFC83D;
  color: var(--navy-dark);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: .04em;
  margin-left: 8px;
}

.notify-badge {
  font-size: 10.5px;
  font-weight: 800;
  background: var(--teal);
  color: var(--white);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: .04em;
  margin-left: 8px;
}

.empty-state {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-light);
  font-size: 14px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.video-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg);
}
.video-card .video-frame { position: relative; padding-top: 56.25%; background: var(--navy-dark); }
.video-card .video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-card .video-info { padding: 12px 14px; }
.video-card .video-title { font-weight: 700; font-size: 13.5px; color: var(--navy); }
.video-card .video-brand { font-size: 12px; color: var(--text-light); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.btn-primary { background: var(--teal); color: var(--white); }
.btn-primary:hover { background: var(--teal-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-secondary { background: var(--white); color: var(--navy); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--teal); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---- Login / Auth screens ---- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, var(--teal-glow), transparent 45%), var(--navy);
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--white);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.auth-card .logo img { height: 64px; margin: 0 auto 18px; }
.auth-card h1 { font-size: 19px; font-weight: 800; color: var(--navy); margin: 0 0 4px; }
.auth-card p.auth-sub { font-size: 13px; color: var(--text-light); margin: 0 0 26px; }
.auth-card .brand-text {
  font-size: 32px;
  font-weight: 800;
  color: var(--teal);
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.auth-card .brand-sub { font-size: 14px; font-weight: 600; color: var(--text-light); margin: 0 0 28px; }
.field { text-align: left; margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
}
.field input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-glow); }
.field .password-wrap { position: relative; }
.field .password-wrap input { padding-right: 44px; }
.field .password-wrap .eye-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--text-light);
}
.field .password-wrap .eye-toggle:hover { color: var(--navy); }
.field .password-wrap .eye-toggle svg { width: 18px; height: 18px; display: block; pointer-events: none; }
.auth-card .btn-primary { background: var(--navy); border-radius: 12px; padding: 15px 22px; }
.auth-card .btn-primary:hover { background: var(--navy-dark); transform: none; box-shadow: none; }
.auth-error {
  display: none;
  background: #FDECEC;
  color: #B3261E;
  font-size: 12.5px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
  text-align: left;
}
.auth-foot { margin-top: 20px; font-size: 12px; color: var(--text-light); }

/* ---- Hub de acceso (3 botones) ---- */
.hub-shell { min-height: 100vh; background: var(--white); display: flex; align-items: center; justify-content: center; padding: 32px; }
.hub-card { width: 100%; max-width: 1280px; }
.hub-card .logo { text-align: center; margin-bottom: 28px; }
.hub-card .logo img { height: 160px; margin: 0 auto; }
.hub-title { text-align: center; color: var(--navy); font-size: 24px; font-weight: 800; margin: 0 0 6px; }
.hub-subtitle { text-align: center; color: var(--text-light); font-size: 14px; margin: 0 0 36px; }
.hub-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 980px) { .hub-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .hub-grid { grid-template-columns: 1fr; } }
.hub-tile {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 52px 30px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transition: transform .18s, box-shadow .18s;
}
.hub-tile:hover { transform: translateY(-4px); box-shadow: 0 18px 48px rgba(45, 62, 80, 0.16); }
.hub-tile .hub-icon {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: var(--teal-light);
  color: var(--teal-dark);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 22px;
}
.hub-tile .hub-icon svg { width: 30px; height: 30px; }
.hub-tile h3 { font-size: 28px; font-weight: 800; color: var(--teal); letter-spacing: -0.01em; margin: 0 0 12px; }
.hub-tile p { font-size: 14px; color: var(--text-light); margin: 0 0 28px; min-height: 40px; }
.hub-tile .btn { background: var(--navy); color: var(--white); border: none; border-radius: 12px; padding: 15px 22px; }
.hub-tile .btn:hover { background: var(--navy-dark); transform: none; box-shadow: none; }
.hub-lock { font-size: 11.5px; color: var(--text-light); margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 4px; }

.responsable-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--warm-bg);
  border: 1px solid #FDE7D7;
  border-radius: 14px;
  padding: 16px 18px;
}
.responsable-card .avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--navy); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; flex-shrink: 0;
}
.responsable-card .info b { font-size: 14px; color: var(--navy); }
.responsable-card .info div { font-size: 12.5px; color: var(--text-light); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: var(--white);
  padding: 12px 20px; border-radius: 999px; font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-lg); z-index: 999; opacity: 0; transition: opacity .2s;
}
.toast.show { opacity: 1; }

.preview-banner {
  position: sticky;
  top: 0;
  z-index: 999;
  background: #FFF4E0;
  color: #8A5A00;
  border-bottom: 2px solid #F0B429;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}
.preview-banner b { font-weight: 800; }

.preview-hint {
  display: none;
  background: var(--teal-light);
  color: var(--teal-dark);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ============================================================
   Responsive — celulares y pantallas angostas
   ============================================================ */
@media (max-width: 600px) {
  .portal-header {
    flex-wrap: wrap;
    row-gap: 8px;
    padding: 12px 16px;
  }
  .portal-header .logo img { height: 34px; }
  .portal-header .back-link { font-size: 13px; }
  .portal-header .session-info { gap: 8px; font-size: 12.5px; }
  .portal-header .session-info #user-name,
  .portal-header .session-info span {
    max-width: 38vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .portal-header .logout-btn { padding: 7px 12px; font-size: 12px; }

  .portal-main { padding: 22px 16px 56px; }
  .portal-eyebrow { font-size: 11px; }
  .portal-title { font-size: 22px; }
  .portal-subtitle { font-size: 13.5px; margin-bottom: 24px; }

  .section-block { padding: 18px 16px; margin-bottom: 18px; }
  .section-block h2 { font-size: 16.5px; }
  .section-block .section-desc { font-size: 13px; margin-bottom: 14px; }

  .file-item {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }
  .file-item .file-meta { width: 100%; }
  .file-item .file-name { white-space: normal; overflow-wrap: anywhere; }
  .file-item .file-actions { width: 100%; }
  .file-item .file-action { flex: 1; text-align: center; }

  .video-grid { grid-template-columns: 1fr; gap: 14px; }

  .btn { padding: 12px 18px; font-size: 13.5px; }

  .auth-shell { padding: 16px; }
  .auth-card { padding: 28px 22px; max-width: 100%; }
  .auth-card .logo img { height: 52px; }
  .auth-card .brand-text { font-size: 26px; }
  .auth-card .brand-sub { margin-bottom: 22px; }

  .hub-shell { padding: 18px; }
  .hub-card .logo img { height: 88px; }
  .hub-title { font-size: 20px; }
  .hub-subtitle { font-size: 13px; margin-bottom: 24px; }
  .hub-tile { padding: 30px 20px; }
  .hub-tile .hub-icon { width: 52px; height: 52px; margin-bottom: 16px; }
  .hub-tile .hub-icon svg { width: 24px; height: 24px; }
  .hub-tile h3 { font-size: 21px; margin-bottom: 8px; }
  .hub-tile p { font-size: 13.5px; min-height: 0; margin-bottom: 20px; }

  .responsable-card { flex-direction: column; align-items: flex-start; gap: 10px; text-align: left; }
}

@media (max-width: 380px) {
  .portal-header .back-link span:not(.icon) { display: none; }
  .portal-title { font-size: 20px; }
  .hub-tile h3 { font-size: 19px; }
  .hub-card .logo img { height: 72px; }
  .file-item .file-action { font-size: 12.5px; padding: 7px 10px; }
}


.avisos-banner {
  background: var(--teal-light);
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.avisos-header {
  font-weight: 800;
  color: var(--teal-dark);
  margin-bottom: 10px;
  font-size: 14.5px;
}

.avisos-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.avisos-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--white);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--text);
}

.avisos-dismiss-btn {
  flex-shrink: 0;
  border: 1px solid var(--teal);
  background: var(--white);
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.avisos-dismiss-btn:hover {
  background: var(--teal-light);
}