:root {
  color-scheme: light dark;
  --gc-action: #88414d;
  --gc-action-hover: #71343f;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-2: #edf1f5;
  --panel-raised: #ffffff;
  --panel-deep: #e8edf3;
  --field: #ffffff;
  --field-border: #c7ced9;
  --text: #171b22;
  --muted: #596273;
  --border: rgba(23, 31, 43, 0.14);
  --line: rgba(23, 31, 43, 0.14);
  --shadow: 0 4px 14px rgba(32, 41, 55, 0.06);
  --accent: #88414d;
  --accent-2: #71343f;
  --accent-strong: #71343f;
  --gc-signal: #88414d;
  --gc-signal-bright: #88414d;
  --green: #1f744b;
  --success: #23784b;
  --success-dark: #185d39;
  --warn: #956000;
  --error: #b8323d;
  --gc-ink: #f4f6f9;
  --gc-panel: #ffffff;
  --gc-panel-raised: #edf1f5;
  --gc-text: #171b22;
  --gc-muted: #596273;
  --gc-line: rgba(23, 31, 43, 0.14);
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"][data-gc-page="404"] body {
  background: #0c0c0d;
  color: #f2f2f5;
}

html[data-theme="dark"][data-gc-page="404"] #message {
  background: #16171b;
  color: #f2f2f5;
}

html[data-theme="dark"][data-gc-page="404"] #message :is(h1, h2, h3),
html[data-theme="dark"][data-gc-page="404"] #load {
  color: #b4b8c1;
}

html[data-theme="light"] body {
  background: var(--bg) !important;
  color: var(--text);
}

html[data-theme="light"] .gc-shell {
  background: rgba(255, 255, 255, 0.91);
  box-shadow: 0 1px 0 rgba(23, 31, 43, 0.04);
}

html[data-theme="light"] .gc-primary a:hover,
html[data-theme="light"] .gc-primary a:focus-visible,
html[data-theme="light"] .gc-primary a[aria-current="page"],
html[data-theme="light"] .gc-login:hover,
html[data-theme="light"] .gc-login:focus-visible {
  background: rgba(23, 31, 43, 0.065);
}

html[data-theme="light"] .gc-login,
html[data-theme="light"] .gc-menu {
  background: rgba(23, 31, 43, 0.035);
}

html[data-theme="light"] .gc-footer {
  background: #e9edf2;
}

html[data-theme="light"] footer:not(.gc-footer) {
  background: #e9edf2 !important;
  border-color: var(--border) !important;
  color: var(--muted);
}

html[data-theme="light"] footer:not(.gc-footer) :is(h2, h3, h4, span) {
  color: var(--text) !important;
}

html[data-theme="light"] .gc-footer__legal {
  color: #6f7887;
}

html[data-theme="light"] .nav {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: var(--border);
}

html[data-theme="light"]:is([data-gc-page="faq"], [data-gc-page="features"], [data-gc-page="privacy"], [data-gc-page="roadmap"], [data-gc-page="terms"]) .hero {
  background: linear-gradient(150deg, rgba(196, 51, 51, 0.08), #ffffff 58%) !important;
  border-color: var(--border);
  box-shadow: var(--shadow);
}

html[data-theme="light"] :is(.card, .step, .notice, .pill, .stat, .table-wrap, .application-card, details, main, .container) {
  border-color: var(--border);
}

html[data-theme="light"] :is(.highlight-card, .signal, .signal-card, .plan, .addon-card, .card.featured, .card.current-plan, #checkoutSummary) {
  background: linear-gradient(150deg, #ffffff, #f1f4f8) !important;
  border-color: var(--border);
  box-shadow: var(--shadow);
}

html[data-theme="light"] :is(.plan--featured, .addon-card--featured, .addon-card.featured, .card.current-plan) {
  background: linear-gradient(150deg, rgba(196, 51, 51, 0.10), #ffffff 48%) !important;
  border-color: rgba(196, 51, 51, 0.45);
}

html[data-theme="light"] :is(.billing-switch, .cycle-toggle, .summary-list li, .summary-cta, .instruction-card, .referral-details, .media-note, .install-compare, .status, .cash-item, details, .note) {
  background: var(--panel-2) !important;
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="light"] :is(.viewer-frame, .image-placeholder, .step-3-grid, .thumb-img-wrapper, .strip-thumb img, .modal-content, .placeholder-box, .video-modal) {
  background-color: #101216;
}

html[data-theme="light"] :is(.plan li, .pricing-note, .instruction, .header p, .card p, .section p) {
  color: var(--text);
}

html[data-theme="light"] :is(input, select, textarea) {
  background: var(--field, #fff) !important;
  border-color: var(--field-border, #c7ced9) !important;
  color: var(--text) !important;
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: #778090;
}

html[data-theme="light"][data-gc-page="login"] .panel,
html[data-theme="light"][data-gc-page="status"] .panel,
html[data-theme="light"][data-gc-page="oauth-complete"] .card,
html[data-theme="light"][data-gc-page="payment-success"] .container,
html[data-theme="light"][data-gc-page="payment-cancel"] .container,
html[data-theme="light"][data-gc-page="connect-return"] .note {
  background: var(--panel) !important;
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow);
}

html[data-theme="light"][data-gc-page="confirm-email"] :is(.btn-secondary, #resend-email) {
  background: var(--panel-2);
  color: var(--text);
}

html[data-theme="light"] :is(.header h1, .intro-section h1, .gallery-info h1, main > h1, main > section > h2, .card h2, .card h3, .container h2) {
  color: var(--text);
}

.gc-theme-toggle {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--gc-line, var(--border, rgba(255,255,255,.12)));
  border-radius: 50%;
  color: var(--gc-text, var(--text, #f4f1ed));
  background: var(--gc-panel-raised, var(--panel-2, #202127));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.gc-theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--accent, var(--gc-signal, #d4483f));
}

.gc-theme-toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent, #d4483f) 72%, transparent);
  outline-offset: 3px;
}

.gc-theme-toggle__icon,
.gc-theme-toggle svg {
  width: 20px;
  height: 20px;
}

.gc-theme-toggle svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

html[data-theme="light"] .gc-theme-toggle__sun,
html[data-theme="dark"] .gc-theme-toggle__moon {
  display: none;
}

.gc-theme-toggle--floating {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1500;
}

@media (max-width: 960px) {
  html[data-theme="light"] .gc-nav-wrap {
    background: #ffffff;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gc-theme-toggle { transition: none; }
}

/* Light surfaces use the app's deeper red without the dark theme's halos. */
html[data-theme="light"] .trial-panel,
html[data-theme="light"] .btn.secondary,
html[data-theme="light"] .gc-brand img,
html[data-theme="light"] .gc-theme-toggle {
  box-shadow: none;
}

html[data-theme="light"] .gc-theme-toggle {
  color: var(--accent);
  background: var(--panel);
  border-color: var(--border);
}

html[data-theme="light"] :is(.gc-trial, .btn:not(.secondary):not(.recommended):not(.store):not(.outline), .button:not(.button--subtle):not(.secondary), .action:not(.secondary), .btn-nav:not(.secondary)) {
  color: #fff;
  background: var(--gc-action);
  border-color: var(--gc-action-hover);
  box-shadow: none;
}

html[data-theme="light"] :is(.gc-trial, .btn:not(.secondary):not(.recommended):not(.store):not(.outline), .button:not(.button--subtle):not(.secondary), .action:not(.secondary), .btn-nav:not(.secondary)):hover {
  background: var(--gc-action-hover);
  filter: none;
  box-shadow: none;
}

html[data-theme="light"] .gc-theme-toggle:focus-visible {
  outline: 3px solid var(--accent);
}

html[data-theme="light"] #guest-alpha-bar {
  box-shadow: none !important;
}

html[data-theme="light"][data-gc-page="how-to-start"] :is(.hero h1, .summary-box h2, .support-card h3, .trial-feedback h2) {
  color: var(--text);
}

html[data-theme="light"][data-gc-page="how-to-start"] .token-badge {
  color: var(--success);
  border-color: var(--success);
}

/* Match dark-theme controls to the deeper red used on light surfaces. */
html[data-theme="dark"] {
  --accent: #df9a9d;
  --accent-2: #71343f;
  --accent-strong: #df9a9d;
  --gc-signal: #88414d;
  --gc-signal-bright: #df9a9d;
}
html[data-theme="dark"] :is(.gc-trial, .btn:not(.secondary):not(.recommended):not(.store):not(.outline), .button:not(.button--subtle):not(.secondary), .action:not(.secondary), .btn-nav:not(.secondary)) {
  color: #fff;
  background: var(--gc-action);
  border-color: var(--gc-action-hover);
  box-shadow: none;
}
html[data-theme="dark"] :is(.gc-trial, .btn:not(.secondary):not(.recommended):not(.store):not(.outline), .button:not(.button--subtle):not(.secondary), .action:not(.secondary), .btn-nav:not(.secondary)):hover {
  background: var(--gc-action-hover);
  filter: none;
  box-shadow: none;
}
html[data-theme="dark"] .gc-theme-toggle {
  color: #df9a9d;
  background: var(--panel, var(--gc-panel));
  border-color: var(--border, var(--gc-line));
  box-shadow: none;
}
html[data-theme="dark"] .gc-theme-toggle:focus-visible {
  outline: 3px solid #df9a9d;
}

/* Give highlighted pricing tiers a distinct green surface in light mode. */
html[data-theme="light"][data-gc-page="pricing"] #plans .plan--featured {
  background: linear-gradient(150deg, #e5f2ec, #f4faf7 68%) !important;
  border-color: #9ab9a8 !important;
  box-shadow: 0 6px 18px rgba(35, 77, 57, 0.06);
}
html[data-theme="light"][data-gc-page="pricing"] #plans .plan--coming {
  background: #edf0f4 !important;
}

/* Green content surfaces; restrained red actions with clearer labels. */
html[data-theme="dark"][data-gc-page="pricing"] #plans .plan--featured {
  background: linear-gradient(155deg, rgba(28, 66, 52, 0.62), rgba(17, 18, 23, 0.98) 64%);
  border-color: rgba(109, 170, 139, 0.55);
}
html[data-theme="dark"][data-gc-page="pricing"] body {
  background: radial-gradient(circle at 16% -6%, rgba(66, 135, 106, 0.12), transparent 31rem), radial-gradient(circle at 92% 9%, rgba(115, 227, 161, 0.06), transparent 24rem), var(--bg);
}
.gc-actions .gc-trial {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.45;
  min-height: 42px;
  text-shadow: none;
}
html[data-gc-page="pricing"] .button { font-weight: 600; letter-spacing: 0.01em; text-shadow: none; }

/* Keep primary authentication actions readable without recoloring secondary or provider buttons. */
html[data-gc-page="login"] #loginBtn,
html[data-gc-page="signup-private"] #submitBtn {
  background: var(--gc-action);
  color: #fff;
  border: 1px solid var(--gc-action-hover);
  box-shadow: none;
}
html[data-gc-page="login"] #loginBtn:hover,
html[data-gc-page="signup-private"] #submitBtn:hover {
  background: var(--gc-action-hover);
  box-shadow: none;
}
html[data-gc-page="login"] #loginBtn:focus-visible,
html[data-gc-page="signup-private"] #submitBtn:focus-visible {
  outline: 3px solid var(--gc-signal-bright);
  outline-offset: 3px;
}
