:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #647086;
  --line: #dfe5ef;
  --accent: #0f766e;
  --accent-2: #b45309;
  --dark: #101623;
  --soft: #e8f3f1;
  --shadow: 0 18px 50px rgba(18, 28, 45, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(15, 118, 110, 0.16), transparent 30%),
    linear-gradient(135deg, #f8fafc 0%, #eef3f8 48%, #f7efe5 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(245, 247, 251, 0.86);
  backdrop-filter: blur(18px);
}

.auth-overlay[hidden] {
  display: none;
}

.auth-card {
  width: min(460px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.auth-subscribe-card {
  width: min(640px, 100%);
}

.auth-card h1,
.auth-card h3,
.sidebar h1,
.topbar h2,
.video-meta h2 {
  margin: 0;
  line-height: 1.05;
}

.auth-card h1 {
  font-size: 44px;
}

.auth-card h3 {
  font-size: 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted,
.message {
  min-height: 1.2em;
  color: var(--muted);
}

.field {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field select,
.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.field input,
.field select {
  padding: 13px 14px;
}

.field input:focus,
.field select:focus,
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.otp-boxes {
  display: grid;
  grid-template-columns: repeat(6, 42px);
  gap: 8px;
}

.field .otp-digit {
  width: 42px;
  height: 48px;
  padding: 0;
  text-align: center;
  font-size: 22px;
  font-weight: 900;
}

.auth-actions,
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.auth-actions {
  margin: 16px 0 6px;
}

.auth-inline-actions {
  margin-top: 4px;
}

.auth-actions-split {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.primary-btn,
.ghost-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 14px;
  font-weight: 800;
}

.primary-btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
}

.auth-actions .primary-btn {
  width: auto;
  flex: 1 1 160px;
}

.auth-actions .secondary-btn,
.auth-actions .ghost-btn {
  flex: 1 1 160px;
}

.secondary-btn {
  background: var(--soft);
  color: #0f4f4a;
}

.ghost-btn {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

.btn-icon {
  font-weight: 900;
}

.admin-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.license-helper {
  margin: 12px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.license-helper p {
  margin: 0 0 8px;
}

.license-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.license-row code {
  display: inline-block;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 800;
}

.license-note {
  color: var(--muted);
  font-size: 0.92rem;
}

#paypal-button-container {
  margin-top: 12px;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 32px;
  border-right: 1px solid rgba(223, 229, 239, 0.85);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(20px);
}

.sidebar h1 {
  font-size: 40px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.search-box span {
  color: var(--accent);
  font-weight: 900;
}

.search-box input {
  min-width: 0;
  border: 0;
  padding: 13px 0;
}

.license-panel {
  display: grid;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.license-panel p {
  margin: 0;
}

#license-label {
  font-weight: 900;
}

.content {
  display: grid;
  gap: 24px;
  padding: 32px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.topbar h2 {
  font-size: 30px;
}

.count-pill {
  margin: 0;
  border-radius: 999px;
  background: #1f2937;
  color: #fff;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
}

.player-stage {
  overflow: hidden;
  border: 1px solid rgba(223, 229, 239, 0.92);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.player {
  display: grid;
  min-height: 360px;
  place-items: center;
  background: var(--dark);
}

.video-frame {
  display: block;
  width: 100%;
  max-width: 980px;
  aspect-ratio: 1.7708830548926013;
  border: 0;
}

.empty-player {
  padding: 42px;
  color: #fff;
  text-align: center;
}

.video-meta {
  padding: 22px 24px 24px;
}

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

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.video-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(18, 28, 45, 0.08);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.video-card:hover,
.video-card:focus,
.video-card.active {
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: 0 18px 38px rgba(18, 28, 45, 0.14);
  transform: translateY(-2px);
  outline: none;
}

.video-thumb {
  display: grid;
  height: 148px;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.92), rgba(180, 83, 9, 0.75)),
    #172033;
}

.play-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  color: #fff;
}

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

.card-category {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
}

.video-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.25;
}

.card-subtitle {
  margin: 0 0 12px;
  color: var(--muted);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-row span {
  border-radius: 999px;
  background: #edf2f7;
  color: #475569;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
    padding: 22px;
  }

  .content {
    padding: 22px;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .player {
    min-height: 220px;
  }
}
