/* TELEGAN Tutoriales — mobile-first, videos verticales (AZ Screen 9:16) */

:root {
  --g: #6dbe45;
  --g-dark: #5aa838;
  --b: #4da1d9;
  --blue: #244575;
  --blue-title: #03477d;
  --alert: #d98233;
  --bg: #f9f9fb;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --dk: #070e18;
  --gradient-primary: linear-gradient(135deg, #6dbe45 0%, #5aa838 100%);
  --gradient-brand: linear-gradient(135deg, #6dbe45 0%, #244575 100%);
  --shadow-md: 0 8px 24px rgba(36, 69, 117, 0.12);
  --radius-lg: 16px;
  --radius-xl: 20px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--safe-bottom);
}

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

/* ─── Header compacto ─── */
.tut-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(249, 249, 251, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(36, 69, 117, 0.08);
  padding: calc(0.75rem + var(--safe-top)) 1rem 0.75rem;
}

.tut-header__inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tut-header__back {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(36, 69, 117, 0.12);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  flex-shrink: 0;
  transition: background 0.2s;
}
.tut-header__back:active { background: rgba(109, 190, 69, 0.12); }

.tut-header__logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(109, 190, 69, 0.25);
}

.tut-header__text h1 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blue-title);
  line-height: 1.2;
}
.tut-header__text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ─── Intro ─── */
.tut-intro {
  max-width: 480px;
  margin: 0 auto;
  padding: 1.25rem 1rem 0.5rem;
}

.tut-intro__badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--g-dark);
  background: rgba(109, 190, 69, 0.12);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.65rem;
}

.tut-intro h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--blue-title);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.tut-intro p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ─── Lista de videos (vertical phone cards) ─── */
.tut-list {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tut-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 0.875rem;
  border: 1px solid rgba(36, 69, 117, 0.08);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.tut-card:active:not(:disabled) {
  transform: scale(0.98);
}
.tut-card:disabled,
.tut-card--soon {
  cursor: default;
  opacity: 0.72;
}

.tut-card__thumb {
  position: relative;
  width: 88px;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(160deg, #0f2318 0%, #244575 100%);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(109, 190, 69, 0.25);
}

.tut-card__thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(109, 190, 69, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(109, 190, 69, 0.06) 1px, transparent 1px);
  background-size: 12px 12px;
}

.tut-card__chapter {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(7, 14, 24, 0.75);
  color: var(--g);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  z-index: 1;
}

.tut-card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.tut-card__play svg {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.tut-card__soon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(7, 14, 24, 0.55);
  z-index: 2;
}

.tut-card__body h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 0.25rem;
  line-height: 1.25;
}

.tut-card__body p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.tut-card__meta {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--g-dark);
}

.tut-card--soon .tut-card__meta { color: var(--text-muted); }

/* ─── Modal video ─── */
.tut-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  visibility: hidden;
  pointer-events: none;
}
.tut-modal.is-open {
  visibility: visible;
  pointer-events: auto;
}

.tut-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 14, 24, 0.88);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.tut-modal.is-open .tut-modal__backdrop { opacity: 1; }

.tut-modal__sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  max-height: 96vh;
  max-height: 96dvh;
  background: var(--dk);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 0.75rem 1rem calc(1rem + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tut-modal.is-open .tut-modal__sheet { transform: translateY(0); }

.tut-modal__handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  margin: 0 auto 0.75rem;
}

.tut-modal__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.tut-modal__title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  flex: 1;
}

.tut-modal__close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.tut-modal__close:active { background: rgba(255, 255, 255, 0.2); }

.tut-modal__frame-wrap {
  position: relative;
  width: 100%;
  max-width: min(100%, calc(78vh * 9 / 16));
  max-width: min(100%, calc(78dvh * 9 / 16));
  margin: 0 auto;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  box-shadow:
    0 0 0 2px rgba(109, 190, 69, 0.35),
    0 16px 48px rgba(0, 0, 0, 0.5);
}

.tut-modal__frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.tut-modal__hint {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.tut-footer {
  max-width: 480px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.tut-footer a { color: var(--blue); font-weight: 600; }

@media (min-width: 520px) {
  .tut-modal__sheet {
    border-radius: var(--radius-xl);
    margin-bottom: 2rem;
    max-height: 92vh;
  }
  .tut-modal {
    align-items: center;
    padding: 1rem;
  }
}
