/* VidPlaza — signup, login, beta redeem pages */

:root {
  --auth-bg: #000000;
  --auth-text: #f8fafc;
  --auth-muted: #94a3b8;
  --auth-muted-dark: #64748b;
  --auth-card: #1e2937;
  --auth-input: #1e293b;
  --auth-border: #334155;
  --auth-accent: #67e8f9;
  --auth-accent-hover: #22d3ee;
  --auth-error: #f87171;
}

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

html, body {
  min-height: 100%;
}

body.auth-page {
  background-color: var(--auth-bg);
  color: var(--auth-text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1.25rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.auth-modal-open {
  overflow: hidden;
}

.auth-shell {
  width: 100%;
  max-width: 28rem;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h1 {
  font-size: 1.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.auth-header p {
  color: var(--auth-muted);
  font-size: 0.95rem;
}

.auth-brand-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--auth-accent);
  text-decoration: none;
  font-size: 0.85rem;
}

.auth-brand-link:hover {
  text-decoration: underline;
}

.auth-google-wrap {
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-google-btn {
  width: auto;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.4rem;
  background: #fff;
  color: #0f172a;
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.2;
  padding: 0.45rem 0.95rem;
  min-height: 2.25rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.auth-google-btn:hover {
  background: #f8fafc;
  border-color: rgba(100, 116, 139, 0.55);
}

.auth-google-btn--soon {
  background: rgba(255, 255, 255, 0.68);
  color: #64748b;
  border: 1px solid var(--auth-border);
  cursor: default;
}

.auth-google-btn--soon:hover {
  background: rgba(255, 255, 255, 0.78);
  color: #64748b;
}

.auth-google-soon-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}

.auth-google-notice {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #a5d8ff;
  text-align: center;
  min-height: 1.1rem;
}

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

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background: var(--auth-border);
}

.auth-divider span {
  font-size: 0.75rem;
  color: var(--auth-muted-dark);
  text-transform: lowercase;
}

.auth-card {
  background: var(--auth-card);
  border: 1px solid var(--auth-border);
  border-radius: 1.5rem;
  padding: 2rem;
}

.auth-card-compact {
  margin-top: 1.5rem;
  padding: 1.75rem;
}

.auth-card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.auth-card-sub {
  color: var(--auth-muted);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  line-height: 1.45;
}

.auth-field {
  margin-bottom: 1.15rem;
}

.auth-field label {
  display: block;
  font-size: 0.875rem;
  color: var(--auth-muted);
  margin-bottom: 0.4rem;
}

.auth-field-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.auth-field-label-row label {
  margin-bottom: 0;
}

.auth-forgot-link {
  flex-shrink: 0;
  font-size: 0.8rem;
  text-decoration: none;
}

.auth-forgot-link:hover {
  text-decoration: underline;
  color: var(--auth-accent-hover);
}

.auth-field label.auth-label-row {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.auth-field-info {
  flex-shrink: 0;
  font-size: 0.72rem;
  line-height: 1;
  color: var(--auth-muted-dark);
  cursor: help;
  opacity: 0.7;
  outline: none;
}

.auth-field-info:hover,
.auth-field-info:focus-visible {
  color: var(--auth-muted);
  opacity: 1;
}

.auth-optional {
  color: var(--auth-muted-dark);
  font-weight: 400;
}

.auth-optional-beta-section {
  margin: 0 0 1.15rem;
  padding: 0.9rem 1rem 0.15rem;
  border: 1px solid rgba(51, 65, 85, 0.65);
  border-radius: 1rem;
  background: rgba(30, 41, 55, 0.45);
}

.auth-optional-beta-section legend {
  padding: 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--auth-muted);
  letter-spacing: 0.02em;
}

.auth-field--nested {
  margin-bottom: 0.85rem;
}

.auth-field-hint {
  font-size: 0.8rem;
  color: var(--auth-muted-dark);
  line-height: 1.45;
  margin: 0 0 0.5rem;
}

.auth-beta-link {
  text-align: center;
  font-size: 0.875rem;
  margin-top: 0.85rem;
}

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

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

.auth-field input {
  width: 100%;
  background: var(--auth-input);
  border: 1px solid var(--auth-border);
  border-radius: 1rem;
  padding: 0.75rem 1rem;
  color: var(--auth-text);
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--auth-accent);
}

.auth-field input::placeholder {
  color: var(--auth-muted-dark);
}

.auth-password-wrap {
  position: relative;
}

.auth-password-wrap .auth-password-input {
  padding-right: 3rem;
}

/* One custom toggle only — hide Edge/Chrome built-in password reveal icons */
.auth-password-wrap input[type="password"]::-ms-reveal,
.auth-password-wrap input[type="password"]::-ms-clear {
  display: none;
}

.auth-password-wrap input[type="password"]::-webkit-credentials-auto-fill-button,
.auth-password-wrap input[type="password"]::-webkit-strong-password-auto-fill-button {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 0.65rem;
  background: transparent;
  color: var(--auth-muted);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  color: var(--auth-text);
  background: rgba(148, 163, 184, 0.12);
  outline: none;
}

.auth-password-toggle.is-visible {
  color: var(--auth-accent);
}

.auth-password-toggle-icon {
  display: block;
}

.auth-submit {
  width: 100%;
  margin-top: 1.5rem;
  background: var(--auth-accent);
  color: #0f172a;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.875rem 1rem;
  border: none;
  border-radius: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.auth-submit:hover {
  background: var(--auth-accent-hover);
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-notice {
  color: #86efac !important;
}

.auth-error {
  display: block;
  color: var(--auth-error);
  font-size: 0.85rem;
  line-height: 1.45;
  margin-top: 0.65rem;
  min-height: 1.1rem;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.auth-footer-note {
  text-align: center;
  font-size: 0.875rem;
  color: var(--auth-muted-dark);
  margin-top: 1.5rem;
}

.auth-footer-note a,
.auth-legal-inline a {
  color: var(--auth-accent);
  text-decoration: none;
}

.auth-footer-note a:hover,
.auth-legal-inline a:hover {
  text-decoration: underline;
}

.auth-legal-inline {
  margin-top: 1rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--auth-muted-dark);
  text-align: center;
}

.accent {
  color: var(--auth-accent);
}

.auth-remember-block {
  margin-bottom: 1.15rem;
}

.auth-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--auth-text);
  line-height: 1.4;
  min-height: 2.75rem;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.auth-checkbox-row input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: var(--auth-accent);
}

.auth-remember-hint {
  margin-top: 0.45rem;
  margin-bottom: 0;
}

.auth-text-link {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--auth-accent);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

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

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.auth-modal[hidden] {
  display: none !important;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}

.auth-modal-content {
  position: relative;
  width: min(100%, 24rem);
  max-height: min(88dvh, calc(100dvh - 2rem));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--auth-card);
  border: 1px solid var(--auth-border);
  border-radius: 1.25rem;
  padding: 1.5rem;
}

.auth-modal-content h2 {
  font-size: 1.15rem;
  margin-bottom: 0.85rem;
}

.auth-modal-content p {
  color: var(--auth-muted);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.auth-modal-close {
  margin-top: 1rem;
}

@media (max-width: 768px) {
  body.auth-page {
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: max(1rem, env(safe-area-inset-top));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }

  .auth-shell {
    max-width: 100%;
    margin: 0 auto;
  }

  .auth-header {
    margin-bottom: 1.35rem;
  }

  .auth-header h1 {
    font-size: 1.55rem;
    line-height: 1.2;
  }

  .auth-header p {
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .auth-card {
    padding: 1.35rem 1.15rem;
    border-radius: 1.15rem;
  }

  .auth-field {
    margin-bottom: 1rem;
  }

  .auth-field input {
    font-size: 16px;
    min-height: 2.75rem;
    padding: 0.8rem 1rem;
  }

  .auth-submit {
    min-height: 2.85rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  /* Google stays compact (label-sized) — still ≥44px tall for touch */
  .auth-google-btn {
    min-height: 2.5rem;
    padding: 0.5rem 1.05rem;
    font-size: 0.9rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .auth-submit {
    margin-top: 1.15rem;
  }

  .auth-error {
    font-size: 0.9rem;
    padding: 0.55rem 0.65rem;
    border-radius: 0.65rem;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.35);
  }

  .auth-error:empty {
    padding: 0;
    border: none;
    background: none;
    min-height: 0;
  }

  .auth-optional-beta-section {
    padding: 0.75rem 0.85rem 0.1rem;
  }

  .auth-field-hint,
  .auth-legal-inline {
    font-size: 0.78rem;
  }

  .auth-footer-note,
  .auth-beta-link {
    font-size: 0.82rem;
    line-height: 1.45;
  }

  .auth-checkbox-row {
    min-height: 3rem;
  }

  .auth-modal {
    align-items: flex-end;
  }

  .auth-modal-content {
    width: 100%;
    border-radius: 1.15rem 1.15rem 0.5rem 0.5rem;
  }
}

@media (max-width: 480px) {
  body.auth-page {
    padding-left: max(0.85rem, env(safe-area-inset-left));
    padding-right: max(0.85rem, env(safe-area-inset-right));
  }

  .auth-header h1 {
    font-size: 1.4rem;
  }

  .auth-card {
    padding: 1.15rem 1rem;
  }

  .auth-divider {
    margin: 1.15rem 0;
  }

  .auth-google-soon-badge {
    font-size: 0.6rem;
  }
}