/**
 * Pulso - Global Styles
 * @version 1.0.0
 * @description Single stylesheet for entire site
 * @dependencies None
 */

/* ==================== Variables ==================== */

:root {
  /* Colors - Public pages */
  --text-base: rgba(255,255,255,0.90);
  --text-dim: rgba(255,255,255,0.70);
  --panel-bg: rgba(0,0,0,0.14);
  --egg: rgba(255,214,79,1);
  --egg-hover: rgba(255,170,64,1);
  --ai-blue: rgba(55,186,254,0.24);
  
  /* Forms */
  --field-bg: rgba(0,0,0,0.22);
  --field-border: rgba(255,255,255,0.18);
  --field-border-focus: rgba(255,255,255,0.34);
  --placeholder: rgba(255,255,255,0.45);
  
  /* Admin palette override */
  --admin-bg: #c8744b;
  --admin-panel: rgba(0,0,0,0.18);
  --admin-text: rgba(255,255,255,0.92);
  --danger: rgba(255,120,120,1);
  --danger-bg: rgba(255,120,120,0.18);
  --line: rgba(255,255,255,0.12);
  --line-soft: rgba(255,255,255,0.08);
}

/* ==================== Reset ==================== */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: "Neue Haas Grotesk", "Helvetica Neue", Helvetica,
               -apple-system, BlinkMacSystemFont, "SF Pro Text",
               "Segoe UI", Roboto, Arial, sans-serif;
  background: transparent;
  color: white;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Admin page override */
body.admin-page {
  background: var(--admin-bg);
}

/* ==================== Background System ==================== */

.background {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #000;
}

.bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 4s ease-in-out;
  will-change: opacity, transform;
}

.bg.active { opacity: 1; }

@keyframes kenburns {
  from { transform: scale(1.06) translate(0%, 0%); }
  to { transform: scale(1.12) translate(-3%, -3%); }
}

.bg {
  animation: kenburns 40s ease-in-out infinite alternate;
}

.bg:nth-child(1) { transform-origin: center center; }
.bg:nth-child(2) { transform-origin: top left; }
.bg:nth-child(3) { transform-origin: bottom right; }

@media (prefers-reduced-motion: reduce) {
  .bg { animation: none; transform: none; }
}

/* ==================== Layout ==================== */

.wrapper {
  position: relative;
  z-index: 1;
  min-height: 100%;
  padding: 14vh 5vw 10vh;
  display: flex;
  justify-content: center;
}

.panel {
  position: relative;
  max-width: 1200px;
  width: 100%;
  margin-top: 1.2rem;
}

/* Admin layout override */
.admin-page .wrapper {
  padding: 32px 28px 40px;
}

.admin-page .panel {
  max-width: 1240px;
  margin-top: 0;
}

/* ==================== Brand ==================== */

.brand {
  position: absolute;
  right: 0;
  top: -4.2rem;
  z-index: 2;
}

.brand a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-base);
}

.brand img {
  height: 44px;
  width: auto;
  display: block;
  opacity: 0.95;
}

.admin-page .brand img {
  height: 22px;
}

/* ==================== Typography ==================== */

.ptext {
  font-size: clamp(1.35rem, 3.2vw, 3.0rem);
  line-height: 1.22;
  color: var(--text-base);
}

p {
  margin: 0 0 5.2rem 0;
  font-size: clamp(1.35rem, 3.2vw, 3.0rem);
  line-height: 1.22;
  color: var(--text-base);
}

p:last-child { margin-bottom: 0; }

.p {
  margin: 0 0 2.2rem 0;
}

.p:last-child { margin-bottom: 0; }

.small { color: var(--text-dim); }

/* ==================== Blocks ==================== */

.block {
  background: var(--panel-bg);
  padding: 5rem 5rem;
  margin-bottom: 3.2rem;
}

.block-title {
  margin: 0 0 2.8rem 0;
}

.h-title {
  margin: 0 0 3.2rem 0;
}

.h-sub {
  margin: 0 0 0.2rem 0;
}

/* ==================== Links ==================== */

.link {
  color: var(--egg);
  text-decoration: none;
  border-bottom: 2px solid rgba(255,214,79,0.28);
  padding-bottom: 0.08em;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.link:hover {
  color: var(--egg-hover);
  border-bottom-color: rgba(255,170,64,0.50);
}

.text-link {
  color: var(--egg);
  text-decoration: none;
  transition: color 0.18s ease;
}

.text-link:hover {
  color: var(--egg-hover);
}

/* ==================== AI Block ==================== */

.ai-block {
  background: var(--ai-blue);
  padding: 4.2rem 5rem;
  margin-bottom: 3.2rem;
}

.ai-link {
  color: var(--egg);
  text-decoration: none;
}

.ai-link:hover {
  color: var(--egg-hover);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

/* ==================== Footer Navigation ==================== */

.footer,
.nav-block {
  background: var(--panel-bg);
  padding: 4.2rem 5rem;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 4rem;
}

.footer-col {
  min-width: 0;
}

.nav-wrap {
  display: flex;
  justify-content: space-between;
  gap: 3rem;
  flex-wrap: wrap;
}

.footer a,
.nav a {
  display: block;
  font-size: clamp(1.35rem, 3.2vw, 3.0rem);
  line-height: 1.22;
  margin-bottom: 0.9rem;
  color: var(--egg);
  text-decoration: none;
  transition: color 0.18s ease;
}

.footer a:last-child,
.nav a:last-child {
  margin-bottom: 0;
}

.footer a:hover,
.nav a:hover {
  color: var(--egg-hover);
}

/* ==================== Session Components ==================== */

.period {
  background: var(--panel-bg);
  padding: 5rem 5rem 3.8rem;
  margin-bottom: 3.0rem;
}

.session {
  background: var(--panel-bg);
  padding: 3.2rem 5rem;
  margin-bottom: 2.2rem;
}

.session:last-of-type { margin-bottom: 0; }

.meta { margin: 0 0 0.55rem 0; }

.date-link {
  color: var(--egg);
  text-decoration: none;
  transition: color 0.18s ease;
}

.date-link:hover { color: var(--egg-hover); }

.ics,
.agenda {
  margin-left: 0.35em;
}

.ics-link,
.agenda-link {
  color: var(--egg);
  text-decoration: none;
  transition: color 0.18s ease;
}

.ics-link:hover,
.agenda-link:hover {
  color: var(--egg-hover);
}

.session-title {
  margin: 0;
  color: var(--text-base);
  text-decoration: none;
}

.session-title:hover { color: rgba(255,255,255,0.99); }

.session-sub { margin: 0.25rem 0 0 0; }

/* ==================== Plans/Pricing ==================== */

.plan {
  background: var(--panel-bg);
  padding: 5rem 5rem;
  margin-bottom: 3.2rem;
}

.plan:last-child { margin-bottom: 0; }

.plan-title {
  margin: 0 0 2.4rem 0;
}

.price {
  margin: 0 0 2.2rem 0;
}

.price strong { font-weight: 600; }

.features {
  margin: 0 0 3rem 0;
}

.feature {
  margin: 0 0 1.2rem 0;
}

.feature:last-child { margin-bottom: 0; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 2.2rem;
}

.cta {
  color: var(--egg);
  text-decoration: none;
  border-bottom: 2px solid rgba(255,214,79,0.28);
  padding-bottom: 0.08em;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.cta:hover {
  color: var(--egg-hover);
  border-bottom-color: rgba(255,170,64,0.50);
}

/* ==================== Forms ==================== */

.form {
  max-width: 720px;
}

.field {
  margin-bottom: 2.4rem;
}

.label {
  display: block;
  margin-bottom: 0.9rem;
  font-size: clamp(1.1rem, 2.2vw, 1.9rem);
  color: rgba(255,255,255,0.78);
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text-base);
  border-radius: 10px;
  padding: 1.25rem 1.3rem;
  font-size: clamp(1.15rem, 2.4vw, 2.0rem);
  line-height: 1.25;
  outline: none;
}

.textarea {
  min-height: 90px;
  resize: vertical;
}

.input::placeholder { color: var(--placeholder); }

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--field-border-focus);
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-start;
}

.remember {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: clamp(1.1rem, 2.2vw, 1.9rem);
  color: rgba(255,255,255,0.78);
}

.remember input {
  width: 22px;
  height: 22px;
  accent-color: var(--egg);
}

.help,
.hint {
  margin-top: 0.6rem;
  font-size: clamp(1.05rem, 2.0vw, 1.7rem);
  color: rgba(255,255,255,0.70);
}

.actions {
  margin-top: 3.4rem;
}

.btn {
  padding: 1.25rem 1.8rem;
  font-size: clamp(1.15rem, 2.4vw, 2.0rem);
  background: var(--egg);
  color: #000;
  border: none;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.18s ease;
}

.btn:hover { background: var(--egg-hover); }

/* ==================== Toggle Component ==================== */

.toggle {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  max-width: 920px;
  margin-top: 1.4rem;
}

.toggle input {
  appearance: none;
  -webkit-appearance: none;
  width: 54px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.14);
  position: relative;
  cursor: pointer;
  flex: 0 0 auto;
  margin-top: 0.15rem;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.toggle input::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.88);
  transition: transform 0.18s ease, background 0.18s ease;
}

.toggle input:checked {
  background: rgba(255,214,79,0.28);
  border-color: rgba(255,214,79,0.45);
}

.toggle input:checked::after {
  transform: translate(22px, -50%);
  background: rgba(255,214,79,1);
}

.toggle-text .hint {
  margin-top: 0.35rem;
}

/* ==================== Admin Components ==================== */

.admin-page .topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-page .h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0.2px;
  font-weight: 600;
  color: var(--admin-text);
}

.admin-page .sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.35;
  max-width: 76ch;
}

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

@media (min-width: 980px) {
  .grid4 {
    grid-template-columns: 420px 1fr;
    grid-template-areas:
      "add-sesion list-sesion"
      "add-video  list-video";
    align-items: start;
  }
  .add-sesion { grid-area: add-sesion; }
  .list-sesion { grid-area: list-sesion; }
  .add-video { grid-area: add-video; }
  .list-video { grid-area: list-video; }
}

.card {
  background: var(--admin-panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.card-h {
  padding: 14px 16px 12px;
  background: rgba(0,0,0,0.12);
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.2px;
}

.card-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.35;
}

.card-body {
  padding: 14px 16px 16px;
}

.admin-page .form {
  display: grid;
  gap: 10px;
  max-width: none;
}

.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.admin-page .field {
  margin-bottom: 0;
}

.admin-page .field label {
  display: block;
  margin: 0 0 6px 0;
  font-size: 11px;
  color: var(--text-dim);
}

.admin-page .input,
.admin-page .select,
.admin-page .textarea {
  padding: 10px;
  font-size: 13px;
}

.admin-page .help {
  margin-top: 6px;
  font-size: 11px;
}

.file {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filebox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px dashed rgba(255,255,255,0.22);
  background: rgba(0,0,0,0.12);
  border-radius: 10px;
}

.filebox span {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file input[type="file"] {
  width: 100%;
  font-size: 12px;
  color: var(--text-dim);
}

.admin-page .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.admin-page .btn {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
  transition: transform 0.06s ease, background 0.18s ease;
  user-select: none;
}

.admin-page .btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--egg);
  color: #000;
}

.btn-primary:hover { background: var(--egg-hover); }

.btn-ghost {
  background: rgba(0,0,0,0.16);
  color: var(--admin-text);
  border: 1px solid rgba(255,255,255,0.14);
}

.btn-ghost:hover { background: rgba(0,0,0,0.22); }

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(255,120,120,0.35);
}

.btn-danger:hover {
  background: rgba(255,120,120,0.26);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

@media (min-width: 980px) {
  .search { width: auto; }
}

.search .input { min-width: 260px; }

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(0,0,0,0.10);
}

.table th,
.table td {
  text-align: left;
  padding: 10px;
  font-size: 12px;
  line-height: 1.25;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  vertical-align: top;
}

.table th {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.18px;
  text-transform: uppercase;
  background: rgba(0,0,0,0.14);
}

.table tr:last-child td { border-bottom: none; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  border: 1px solid rgba(255,255,255,0.16);
  color: var(--text-dim);
}

.badge.ok {
  color: rgba(190,255,210,0.95);
  border-color: rgba(190,255,210,0.28);
  background: rgba(190,255,210,0.10);
}

.badge.wait {
  color: rgba(255,236,170,0.95);
  border-color: rgba(255,236,170,0.26);
  background: rgba(255,236,170,0.10);
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.a {
  color: var(--egg);
  text-decoration: none;
  font-size: 12px;
}

.a:hover { color: var(--egg-hover); }

/* ==================== Responsive ==================== */

@media (max-width: 600px) {
  .wrapper { padding: 16vh 3vw 10vh; }
  .panel { margin-top: 2.4rem; }

  .brand { top: -3.4rem; }
  .brand img { height: 38px; }

  .ptext,
  p {
    font-size: clamp(1.25rem, 3vw, 1.8rem);
    line-height: 1.32;
  }

  .block,
  .ai-block,
  .nav-block,
  .plan {
    padding: 3.5rem 2rem;
    margin-bottom: 2.4rem;
  }

  .period {
    padding: 3.2rem 2rem 2.6rem;
    margin-bottom: 2.4rem;
  }

  .session {
    padding: 2.6rem 2rem;
    margin-bottom: 1.6rem;
  }

  .footer {
    padding: 3.2rem 2rem;
    flex-direction: column;
    gap: 2.2rem;
  }

  .footer a,
  .nav a {
    font-size: clamp(1.25rem, 3vw, 1.8rem);
    line-height: 1.32;
    margin-bottom: 0.65rem;
  }

  .row,
  .row2 {
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .admin-page .wrapper { padding: 24px 16px 32px; }
  .search .input { min-width: 0; width: 100%; }

  #tableSesiones th:nth-child(4),
  #tableSesiones td:nth-child(4) { display: none; }

  #tableVideos th:nth-child(3),
  #tableVideos td:nth-child(3) { display: none; }
}
