/* Light mode (default) */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-dim: #f1f3f5;
  --border: #dfe3e8;
  --text: #1a1f2b;
  --text-secondary: #3b4252;
  --text-muted: #6e7a8a;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --error: #ef4444;
  --input-bg: #f1f3f5;
}

/* Dark mode */
html.dark {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-dim: #1a1a1a;
  --border: #262626;
  --text: #fafafa;
  --text-secondary: #d4d4d8;
  --text-muted: #a1a1aa;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --error: #ef4444;
  --input-bg: #0a0a0a;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-color: var(--accent);
}

button {
  width: 100%;
  padding: 0.75rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: background 0.2s;
}

button:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.error-msg {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 0.75rem;
  display: none;
}

.error-msg.visible { display: block; }

/* Video player */
.video-container {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

video {
  width: 100%;
  display: block;
}

.video-title {
  margin-top: 1.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.video-title__sub {
  font-size: 0.85em;
  font-weight: 400;
  color: var(--text-muted);
}

.video-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.video-link {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.video-link a {
  color: var(--accent);
  text-decoration: none;
}

.video-link a:hover {
  text-decoration: underline;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.site-header__logo {
  height: 36px;
  width: 36px;
  border-radius: 8px;
}

.site-header__title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text);
}

.site-header__subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-header__actions a {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.site-header__actions a:hover {
  color: var(--text);
  background: var(--surface-dim);
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--surface-dim);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  color: var(--text-muted);
  padding: 0;
  margin: 0;
}

.theme-toggle:hover {
  background: var(--border);
  color: var(--text);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* Footer */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface);
  flex-shrink: 0;
}

.site-footer__left,
.site-footer__center,
.site-footer__right {
  flex: 1;
}

.site-footer__left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-footer__logo {
  height: 16px;
  width: 16px;
  border-radius: 3px;
  opacity: 0.6;
}

.site-footer__center {
  text-align: center;
}

.site-footer__right {
  text-align: right;
}

.site-footer__right a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.site-footer__right a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .site-header {
    padding: 0 1rem;
    height: 56px;
  }

  .site-header__subtitle {
    display: none;
  }

  .site-header__actions a {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
  }

  .container {
    padding: 1.25rem 1rem;
  }

  .card {
    padding: 1.5rem;
  }

  h1 {
    font-size: 1.25rem;
  }

  .video-title {
    font-size: 1.1rem;
  }

  .site-footer {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    padding: 1rem;
  }

  .site-footer__right {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .site-header__logo {
    height: 28px;
    width: 28px;
  }

  .site-header__title {
    font-size: 0.9rem;
  }

  .theme-toggle {
    width: 32px;
    height: 32px;
  }

  .card {
    padding: 1.25rem;
  }
}
