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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #111111;
  color: #ececec;
  min-height: 100vh;
}

/* ── Page layout ────────────────────────────────────────────────── */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.auth-logo {
  margin-bottom: 28px;
  display: flex;
  justify-content: center;
}
.auth-logo img {
  height: 48px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #1c1c1c;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 36px 32px;
}

/* ── Typography ─────────────────────────────────────────────────── */

.auth-card h1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}
.auth-subtitle {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.38);
  margin-bottom: 26px;
  line-height: 1.5;
}

/* ── Form elements ──────────────────────────────────────────────── */

.auth-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin: 18px 0 6px;
}
.auth-label:first-of-type { margin-top: 0; }

.auth-input {
  display: block;
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #fff;
  padding: 11px 14px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.auth-input:focus {
  outline: none;
  border-color: rgba(127,0,255,0.55);
  box-shadow: 0 0 0 3px rgba(127,0,255,0.12);
}
.auth-input::placeholder { color: rgba(255,255,255,0.2); }

.auth-hint {
  font-size: 0.74rem;
  color: rgba(255,255,255,0.3);
  margin-top: 4px;
}

/* ── Buttons ────────────────────────────────────────────────────── */

.auth-submit {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 13px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  border: none;
  outline: none;
  border-radius: 11px;
  cursor: pointer;
  background: linear-gradient(135deg, #7f00ff, #ff00ff);
  color: #fff;
  transition: opacity 0.2s;
}
.auth-submit:hover { opacity: 0.87; }
.auth-submit:disabled { opacity: 0.4; cursor: not-allowed; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: rgba(255,255,255,0.2);
  font-size: 0.75rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.07);
}

.yt-login-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  box-sizing: border-box;
}
.yt-login-btn:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.2);
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.75);
  font-size: 0.88rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
}
.google-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
}
.google-btn img { width: 18px; height: 18px; }

/* ── TOS checkbox row ───────────────────────────────────────────── */

.tos-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
}
.tos-row input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  accent-color: #7f00ff;
}
.tos-row span {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
  line-height: 1.55;
}
.tos-row a { color: #a855f7; text-decoration: none; }
.tos-row a:hover { color: #c084fc; }

/* ── Footer links ───────────────────────────────────────────────── */

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.3);
}
.auth-footer + .auth-footer { margin-top: 8px; }
.auth-footer a { color: #a855f7; text-decoration: none; }
.auth-footer a:hover { color: #c084fc; }

/* ── Flash messages ─────────────────────────────────────────────── */

.auth-flash {
  padding: 11px 14px;
  border-radius: 9px;
  margin-bottom: 18px;
  font-size: 0.83rem;
  line-height: 1.4;
}
.auth-flash.error   { background: rgba(127,29,29,0.5);  color: #fca5a5; border: 1px solid rgba(127,29,29,0.8); }
.auth-flash.success { background: rgba(20,41,14,0.7);   color: #86efac; border: 1px solid rgba(22,101,52,0.8); }

/* ── Info page (check_email, etc.) ─────────────────────────────── */

.auth-info-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  text-align: center;
}
.auth-info-page .auth-logo { margin-bottom: 36px; }
.auth-info-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7f00ff22, #ff00ff22);
  border: 1px solid rgba(127,0,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 1.8rem;
}
.auth-info-page h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
}
.auth-info-page p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.65;
  max-width: 340px;
  margin: 0 auto 10px;
}
.auth-info-page a { color: #a855f7; text-decoration: none; }
.auth-info-page a:hover { color: #c084fc; }

/* ── Settings page ──────────────────────────────────────────────── */

.settings-page {
  min-height: 100vh;
  padding: 40px 16px 60px;
}
.settings-inner {
  max-width: 540px;
  margin: 0 auto;
}
.settings-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  margin-bottom: 28px;
  transition: color 0.15s;
}
.settings-back:hover { color: rgba(255,255,255,0.7); }
.settings-page h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 24px;
}
.settings-card {
  background: #1c1c1c;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 26px 28px;
  margin-bottom: 16px;
}
.settings-card h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 18px;
}
.settings-card p {
  font-size: 0.84rem;
  color: rgba(255,255,255,0.38);
  margin-bottom: 16px;
  line-height: 1.55;
}
.settings-card .auth-label { margin-top: 14px; }
.settings-card .auth-label:first-of-type { margin-top: 0; }
.settings-save {
  margin-top: 18px;
  padding: 10px 24px;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  border: none;
  outline: none;
  border-radius: 9px;
  cursor: pointer;
  background: linear-gradient(135deg, #7f00ff, #ff00ff);
  color: #fff;
  transition: opacity 0.2s;
}
.settings-save:hover { opacity: 0.87; }
.settings-card select.auth-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.35)' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-color: rgba(255,255,255,0.04);
  padding-right: 36px;
}
.settings-card select.auth-input option { background: #1c1c1c; }
.settings-danger { border-color: rgba(239,68,68,0.3); }
.settings-danger h2 { color: #f87171; }
.danger-btn {
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid rgba(239,68,68,0.4);
  border-radius: 9px;
  background: rgba(127,29,29,0.25);
  color: #f87171;
  cursor: pointer;
  outline: none;
  transition: background 0.15s, border-color 0.15s;
}
.danger-btn:hover { background: rgba(127,29,29,0.45); border-color: rgba(239,68,68,0.7); }
.danger-confirm {
  margin-top: 16px;
  padding: 16px;
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  border: 1px solid rgba(239,68,68,0.25);
}
.danger-confirm p { font-size: 0.83rem; color: #fca5a5; margin-bottom: 10px; }
.yt-reconnect-btn {
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 9px;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  outline: none;
  transition: background 0.15s, border-color 0.15s;
}
.yt-reconnect-btn:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.22); }
.settings-hint {
  font-size: 0.76rem;
  color: rgba(255,255,255,0.25);
  margin-top: 5px;
}
