/*
 * Website palette synchronized with the Iranian application theme.
 * This file is intentionally loaded after page-level styles so old page
 * palettes cannot reintroduce the former green brand or graphite backgrounds.
 */

:root {
  --ct-primary: #23b6ff;
  --ct-primary-hover: #14e0a5;
  --ct-primary-strong: #006eaa;
  --ct-primary-ink: #031820;
  --ct-primary-soft: #e8f7ff;
  --ct-primary-muted: #cdeeff;
  --ct-primary-border: #9edfff;
  --ct-primary-gradient: linear-gradient(135deg, #23b6ff 0%, #14e0a5 100%);
  --ct-primary-gradient-hover: linear-gradient(135deg, #14e0a5 0%, #23b6ff 100%);

  --ct-ink: #14212a;
  --ct-ink-soft: #263741;
  --ct-muted: #66737b;
  --ct-subtle: #84939c;
  --ct-bg: #ffffff;
  --ct-surface: #ffffff;
  --ct-surface-elevated: #fafcfd;
  --ct-surface-soft: #eef3f6;
  --ct-surface-tint: #f5fbfe;
  --ct-border: #dde7ec;
  --ct-border-soft: #edf3f6;
  --ct-border-strong: #c7d5dd;
  --ct-dark: #0a233d;
  --ct-dark-deep: #050a10;
  --ct-dark-soft: #102a43;
  --ct-on-dark: #f3f7fb;

  --ct-rgb-primary: 35 182 255;
  --ct-rgb-gradient-end: 20 224 165;
  --ct-rgb-ink: 20 33 42;
  --ct-rgb-surface: 255 255 255;
  --ct-rgb-dark: 5 10 16;
}

html[data-theme="dark"] {
  --ct-primary: #23b6ff;
  --ct-primary-hover: #14e0a5;
  --ct-primary-strong: #7dd5ff;
  --ct-primary-ink: #031820;
  --ct-primary-soft: #0b3048;
  --ct-primary-muted: #123e57;
  --ct-primary-border: #245b79;

  --ct-ink: #f3f7fb;
  --ct-ink-soft: #d8e4ee;
  --ct-muted: #a7b7c8;
  --ct-subtle: #8094a8;
  --ct-bg: #050a10;
  --ct-surface: #0a233d;
  --ct-surface-elevated: #181531;
  --ct-surface-soft: #102a43;
  --ct-surface-tint: #181531;
  --ct-border: #29435d;
  --ct-border-soft: #203a53;
  --ct-border-strong: #464064;
  --ct-dark: #0a233d;
  --ct-dark-deep: #050a10;
  --ct-dark-soft: #102a43;
  --ct-on-dark: #f3f7fb;

  --ct-rgb-ink: 243 247 251;
  --ct-rgb-surface: 10 35 61;
  color-scheme: dark;
}

body {
  color: var(--ct-ink);
  background-color: var(--ct-bg);
}

/* Primary actions mirror PrimaryGradientButton in the application. */
:where(
  .button,
  .header-register,
  .cta-primary,
  .primary,
  .course-card-cta,
  .cart-summary__primary,
  .cart-empty a,
  .checkout-submit,
  .checkout-payment-button,
  .checkout-complete a.is-primary,
  .app-page-platform-card__button,
  .articles-primary-button,
  .articles-featured-card__button,
  .article-detail-v2-course-card a,
  .account-sidebar-support a,
  .account-btn--primary,
  .account-course-row__button,
  .account-dashboard-promo__content a,
  .account-shop-order-card__action,
  .info-button--primary,
  .product-order-action,
  .catalog-search button,
  .catalog-filter-submit,
  .catalog-course-cta,
  .shop-filter-submit,
  .shop-search button,
  .shop-price-filter button,
  .shop-empty-state a,
  .session-complete-button,
  .course-detail-primary-action,
  .course-review-submit,
  .teachers-primary-button,
  .product-detail-buy,
  .account-action-primary,
  button[type="submit"].is-primary,
  input[type="submit"].is-primary
) {
  color: var(--ct-primary-ink);
  background: var(--ct-primary-gradient);
  border-color: transparent;
  box-shadow: 0 10px 24px rgb(var(--ct-rgb-primary) / 0.2);
}

:where(
  .button,
  .header-register,
  .cta-primary,
  .primary,
  .course-card-cta,
  .cart-summary__primary,
  .cart-empty a,
  .checkout-submit,
  .checkout-payment-button,
  .checkout-complete a.is-primary,
  .app-page-platform-card__button,
  .articles-primary-button,
  .articles-featured-card__button,
  .article-detail-v2-course-card a,
  .account-sidebar-support a,
  .account-btn--primary,
  .account-course-row__button,
  .account-dashboard-promo__content a,
  .account-shop-order-card__action,
  .info-button--primary,
  .product-order-action,
  .catalog-search button,
  .catalog-filter-submit,
  .catalog-course-cta,
  .shop-filter-submit,
  .shop-search button,
  .shop-price-filter button,
  .shop-empty-state a,
  .session-complete-button,
  .course-detail-primary-action,
  .course-review-submit,
  .teachers-primary-button,
  .product-detail-buy,
  .account-action-primary,
  button[type="submit"].is-primary,
  input[type="submit"].is-primary
):hover {
  color: var(--ct-primary-ink);
  background: var(--ct-primary-gradient-hover);
  border-color: transparent;
  box-shadow: 0 13px 30px rgb(var(--ct-rgb-primary) / 0.26);
}

/* Common primary icon tiles and badges receive the same two-color treatment. */
:where(
  .hero-icon,
  .panel-icon,
  .intro-icon,
  .info-icon,
  .account-sidebar-link__icon,
  .checkout-complete__icon,
  .teacher-avatar span
) {
  background: var(--ct-primary-gradient);
  color: var(--ct-primary-ink);
}

/* Animated homepage: use the app surfaces without large background gradients. */
:root {
  --lime: #23b6ff;
  --teal: #23b6ff;
  --teal-readable: #006eaa;
  --teal-soft: #cdeeff;
  --accent-text: #006eaa;
  --deep: #ffffff;
  --deep-2: #eef3f6;
  --paper: #ffffff;
  --paper-2: #fafcfd;
  --ink: #14212a;
  --muted: #66737b;
  --line-dark: rgb(20 33 42 / 0.13);
  --line-light: rgb(20 33 42 / 0.11);
}

:root[data-theme="dark"] {
  --lime: #23b6ff;
  --teal: #23b6ff;
  --teal-readable: #7dd5ff;
  --teal-soft: #123e57;
  --accent-text: #7dd5ff;
  --deep: #050a10;
  --deep-2: #0a233d;
  --paper: #0a233d;
  --paper-2: #181531;
  --ink: #f3f7fb;
  --muted: #a7b7c8;
  --line-dark: rgb(167 183 200 / 0.18);
  --line-light: rgb(167 183 200 / 0.12);
}

:root[data-theme="dark"] .chapter,
:root[data-theme="dark"] .chapter--light {
  --chapter-bg: #050a10;
  --chapter-ink: #f3f7fb;
  --chapter-muted: #a7b7c8;
  --chapter-line: rgb(167 183 200 / 0.14);
}

:root[data-theme="light"] .chapter,
:root[data-theme="light"] .chapter--light {
  --chapter-bg: #ffffff;
  --chapter-ink: #14212a;
  --chapter-muted: #66737b;
  --chapter-line: rgb(20 33 42 / 0.11);
}

:root[data-theme="dark"] .chapter::before,
:root[data-theme="dark"] .chapter--light::before {
  background:
    radial-gradient(circle at 18% 25%, rgb(var(--ct-rgb-primary) / 0.055), transparent 30%),
    #050a10;
}

:root[data-theme="dark"] .hero-chapter::before {
  background:
    radial-gradient(ellipse at 20% 38%, rgb(var(--ct-rgb-primary) / 0.1), transparent 35%),
    linear-gradient(90deg, rgb(5 10 16 / 0.12), rgb(5 10 16 / 0.4) 50%, rgb(5 10 16 / 0.72)),
    #050a10;
}

:root[data-theme="dark"] .course-chapter {
  --chapter-bg: #0a233d;
}

:root[data-theme="dark"] .course-card,
:root[data-theme="dark"] .home-featured-course-card {
  color: #f3f7fb;
  background: rgb(10 35 61 / 0.9);
  border-color: #29435d;
}

:root[data-theme="dark"] .site-header {
  background: rgb(10 35 61 / 0.88);
  border-color: #29435d;
}

:root[data-theme="dark"] .site-footer,
:root[data-theme="dark"] .mobile-nav.open {
  color: #f3f7fb;
  background: #0a233d;
  border-color: #29435d;
}

:root[data-theme="dark"] dialog {
  color: #f3f7fb;
  background: #181531;
  border-color: #464064;
}

/* Old hard-coded homepage green text is overridden after its stylesheet. */
:root[data-theme="light"] :where(
  .chapter h1 em,
  .chapter h2 em,
  .kicker,
  .chapter-label b,
  .course-count b,
  .bench-label,
  .chapter-progress button.active
) {
  color: #006eaa;
}

:root[data-theme="dark"] :where(
  .chapter h1 em,
  .chapter h2 em,
  .kicker,
  .chapter-label b,
  .course-count b,
  .bench-label,
  .chapter-progress button.active
) {
  color: #7dd5ff;
}

.primary,
.chapter--light .primary,
.model-controls button[aria-pressed="true"],
.course-select button[aria-pressed="true"] {
  color: #031820;
  background: var(--ct-primary-gradient);
  border-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  :where(.button, .header-register, .cta-primary, .primary) {
    transition: none;
  }
}
