/* IWA Academy public theme layer. Loaded after legacy public styles. */
:root {
  color-scheme: dark;
  --public-bg: #1e2024;
  --public-surface: #212428;
  --public-surface-2: #191b1e;
  --public-text: #c4cfde;
  --public-heading: #f7f8fa;
  --public-muted: #8d96a5;
  --public-border: rgba(255,255,255,.12);
  --public-border-strong: rgba(255,255,255,.22);
  --public-input: #191b1e;
  --public-input-text: #fff;
  --public-primary: #ff014f;
  --public-primary-soft: rgba(255,1,79,.12);
  --public-shadow: 0 18px 55px rgba(0,0,0,.28);
  --public-focus: 0 0 0 3px rgba(255,1,79,.22);
  --bar-bg: rgba(20, 22, 26, 0.72);
  --bar-border: rgba(255, 255, 255, 0.10);
  --bar-text: #c4cfde;
  --bar-text-hover: #ffffff;
  --bar-shadow: 0 10px 40px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.06);
  --panel-bg: rgba(20, 22, 26, 0.88);
  --panel-shadow: 0 -12px 48px rgba(0,0,0,0.50);
  --panel-item-bg: rgba(255, 255, 255, 0.04);
  --panel-item-border: rgba(255, 255, 255, 0.06);
  --panel-item-hover-bg: rgba(255, 255, 255, 0.10);
  --panel-item-hover-border: rgba(255, 255, 255, 0.18);
}

html[data-theme="light"] {
  color-scheme: light;
  --public-bg: #f4f7fb;
  --public-surface: #ffffff;
  --public-surface-2: #eef2f7;
  --public-text: #425066;
  --public-heading: #172033;
  --public-muted: #68758a;
  --public-border: rgba(24,37,58,.14);
  --public-border-strong: rgba(24,37,58,.25);
  --public-input: #ffffff;
  --public-input-text: #172033;
  --public-primary: #df0046;
  --public-primary-soft: rgba(223,0,70,.09);
  --public-shadow: 0 18px 55px rgba(31,49,78,.14);
  --public-focus: 0 0 0 3px rgba(223,0,70,.18);
  --bar-bg: rgba(255, 255, 255, 0.68);
  --bar-border: rgba(24, 37, 58, 0.14);
  --bar-text: #425066;
  --bar-text-hover: #172033;
  --bar-shadow: 0 10px 40px rgba(31,49,78,.14), inset 0 1px 0 rgba(255,255,255,0.80);
  --panel-bg: rgba(244, 247, 251, 0.92);
  --panel-shadow: 0 -12px 48px rgba(31,49,78,.14);
  --panel-item-bg: rgba(24, 37, 58, 0.03);
  --panel-item-border: rgba(24, 37, 58, 0.10);
  --panel-item-hover-bg: rgba(24, 37, 58, 0.07);
  --panel-item-hover-border: rgba(24, 37, 58, 0.20);
}

html, body { background: var(--public-bg); color: var(--public-text); }
body { transition: background-color .18s ease, color .18s ease; }
body, body * { border-color: var(--public-border); }

.public-theme-toggle {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 9999;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--public-border-strong);
  border-radius: 50%;
  background: var(--public-surface);
  color: var(--public-heading);
  box-shadow: var(--public-shadow);
  cursor: pointer;
}
.public-theme-toggle:hover { color: var(--public-primary); border-color: var(--public-primary); }
.public-theme-toggle:focus-visible { outline: none; box-shadow: var(--public-focus); }

/* Shared public surfaces and typography. */
html[data-theme="light"] .section-separator,
html[data-theme="light"] .rn-footer-area,
html[data-theme="light"] .header--fixed,
html[data-theme="light"] .popup-mobile-menu .inner { background: var(--public-bg) !important; }
html[data-theme="light"] .rn-header.header--fixed { background: rgba(255,255,255,.94) !important; border-bottom: 1px solid var(--public-border); }
html[data-theme="light"] .rn-header a, html[data-theme="light"] .mainmenu-nav a { color: var(--public-text); }
html[data-theme="light"] .rn-header a:hover, html[data-theme="light"] .mainmenu-nav a:hover { color: var(--public-primary); }
html[data-theme="light"] .heading, html[data-theme="light"] h1, html[data-theme="light"] h2, html[data-theme="light"] h3, html[data-theme="light"] h4, html[data-theme="light"] h5, html[data-theme="light"] h6 { color: var(--public-heading); }
html[data-theme="light"] p, html[data-theme="light"] .description, html[data-theme="light"] .subtitle, html[data-theme="light"] .text-muted { color: var(--public-text) !important; }
html[data-theme="light"] .rn-btn { color: #fff !important; background: var(--public-primary) !important; }
html[data-theme="light"] .card, html[data-theme="light"] .course-card, html[data-theme="light"] .blog-card, html[data-theme="light"] .rn-portfolio { background: var(--public-surface) !important; border-color: var(--public-border) !important; box-shadow: var(--public-shadow); }
html[data-theme="light"] input:not([type="checkbox"]):not([type="radio"]), html[data-theme="light"] select, html[data-theme="light"] textarea { background: var(--public-input) !important; color: var(--public-input-text) !important; border: 1px solid var(--public-border-strong) !important; }
html[data-theme="light"] input::placeholder, html[data-theme="light"] textarea::placeholder { color: var(--public-muted) !important; }

/* Standalone auth pages. */
.public-auth-page { min-height: 100vh; background: var(--public-bg) !important; color: var(--public-text) !important; padding: 24px; }
.public-auth-card, .public-auth-page .login-container { background: var(--public-surface) !important; color: var(--public-text) !important; border: 1px solid var(--public-border) !important; box-shadow: var(--public-shadow) !important; }
.public-auth-card { width: min(100%, 470px); margin: auto; padding: 34px; border-radius: 20px; }
.public-auth-brand { text-align: center; margin-bottom: 18px; }
.public-auth-brand img { width: auto; max-width: 130px; max-height: 70px; object-fit: contain; }
.public-auth-heading h1, .public-auth-page .login-header h2 { color: var(--public-heading) !important; }
.public-auth-heading p, .public-auth-page .auth-footer span { color: var(--public-muted) !important; }
.public-auth-form { display: grid; gap: 16px; }
.public-auth-form label { color: var(--public-text); font-size: 13px; font-weight: 700; }
.public-auth-form input, .public-auth-page .form-control { width: 100%; min-height: 48px; margin-top: 7px; padding: 0 14px; background: var(--public-input) !important; color: var(--public-input-text) !important; border: 1px solid var(--public-border-strong) !important; border-radius: 10px; box-shadow: none !important; }
.public-auth-form input:focus, .public-auth-page .form-control:focus { border-color: var(--public-primary) !important; box-shadow: var(--public-focus) !important; outline: none; }
.public-auth-form input[readonly] { opacity: .72; cursor: not-allowed; }
.public-auth-form small { display: block; margin-top: 6px; color: var(--public-muted); font-weight: 400; }
.public-auth-submit, .public-auth-page .btn-login { width: 100%; min-height: 48px; border: 0; border-radius: 10px; background: var(--public-primary) !important; color: #fff !important; font-weight: 800; cursor: pointer; box-shadow: 0 10px 24px rgba(255,1,79,.2) !important; }
.public-auth-submit:hover, .public-auth-page .btn-login:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
.public-auth-error, .public-auth-page .alert-error { padding: 12px 14px; margin-bottom: 16px; color: var(--public-primary) !important; background: var(--public-primary-soft) !important; border: 1px solid var(--public-primary) !important; border-radius: 10px; }
.public-auth-page .auth-link, .public-auth-page .forgot-link { color: var(--public-primary) !important; }
.google-auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--public-muted); font-size: 11px; font-weight: 800; }
.google-auth-divider::before, .google-auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--public-border); }
.google-auth-wrap { display: flex; justify-content: center; min-height: 42px; }

@media (max-width: 600px) {
  .public-theme-toggle { top: 12px; right: 12px; width: 38px; height: 38px; }
  .public-auth-page { padding: 14px; }
  .public-auth-card, .public-auth-page .login-container { padding: 24px 18px !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}


/* Header controls override the fixed auth-page position. */
.rn-header .public-theme-toggle-header,
.popup-mobile-menu .public-theme-toggle-mobile {
  position: relative;
  top: auto;
  right: auto;
  z-index: 2;
  width: 36px;
  height: 36px;
  margin: 0 8px;
  box-shadow: none;
  flex: 0 0 auto;
}
.popup-mobile-menu .menroll { display: flex; align-items: center; justify-content: center; gap: 10px; }
@media (max-width: 1199px) {
  .rn-header .public-theme-toggle-header { display: none; }
}
@media (min-width: 1200px) {
  .popup-mobile-menu .public-theme-toggle-mobile { display: none; }
}


/* Google profile completion controls. */
.public-auth-form select { width: 100%; min-height: 48px; margin-top: 7px; padding: 0 14px; background: var(--public-input) !important; color: var(--public-input-text) !important; border: 1px solid var(--public-border-strong) !important; border-radius: 10px; }
.public-auth-form select:focus { outline: none; border-color: var(--public-primary) !important; box-shadow: var(--public-focus) !important; }
.public-auth-submit:disabled { opacity: .45; cursor: not-allowed; transform: none !important; filter: grayscale(.2); }
.profile-field-status, .profile-field-hint { color: var(--public-muted); font-size: 11px; font-weight: 500; }
.profile-field-status[data-state="checking"] { color: #d99a2b; }
.profile-field-status[data-state="success"] { color: #18b981; }
.profile-field-status[data-state="error"] { color: var(--public-primary); }


/* Neo-glass authentication surface and light-mode readability. */
.public-auth-page .login-container,
.public-auth-page .public-auth-card {
  background: linear-gradient(145deg, color-mix(in srgb, var(--public-surface) 88%, transparent), color-mix(in srgb, var(--public-surface-2) 84%, transparent)) !important;
  border: 1px solid var(--public-border-strong) !important;
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  box-shadow: 0 24px 80px rgba(15, 23, 42, .20), inset 0 1px 0 rgba(255,255,255,.10) !important;
}
.public-auth-page .login-header h2,
.public-auth-page .login-header p,
.public-auth-page .form-group label,
.public-auth-page .auth-footer,
.public-auth-page .auth-footer span,
.public-auth-page .hint-text,
.public-auth-page .pw-msg,
.public-auth-page .match-msg { color: var(--public-text) !important; }
.public-auth-page .form-control,
.public-auth-page select.form-control { color: var(--public-input-text) !important; background: var(--public-input) !important; border: 1px solid var(--public-border-strong) !important; }
.public-auth-page .form-control::placeholder { color: var(--public-muted) !important; opacity: 1; }
.public-auth-page .forgot-link { color: var(--public-muted) !important; }
.public-auth-page .forgot-link:hover { color: var(--public-primary) !important; }
html[data-theme="light"] .public-auth-page .login-container,
html[data-theme="light"] .public-auth-page .public-auth-card { box-shadow: 0 24px 70px rgba(31,49,78,.16), inset 0 1px 0 rgba(255,255,255,.8) !important; }
@supports not (color: color-mix(in srgb, white 50%, black)) {
  .public-auth-page .login-container, .public-auth-page .public-auth-card { background: var(--public-surface) !important; }
}


/* Advanced public theme surfaces: soft neutral light mode instead of flat white. */
html[data-theme="light"] body {
  background:
    radial-gradient(circle at 12% 0%, rgba(223,0,70,.055), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(37,99,235,.055), transparent 30%),
    #edf2f7 !important;
}

html[data-theme="light"] .rn-header.header--fixed {
  background: linear-gradient(135deg, rgba(255,255,255,.88), rgba(232,238,246,.92)) !important;
  border-bottom: 1px solid rgba(24,37,58,.14) !important;
  box-shadow: 0 10px 30px rgba(31,49,78,.10), inset 0 1px 0 rgba(255,255,255,.86) !important;
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}

html[data-theme="light"] .rn-header.header--fixed .header-wrapper,
html[data-theme="light"] .rn-header.header--fixed .header-right,
html[data-theme="light"] .rn-header.header--fixed .header-left {
  background: transparent !important;
}

html[data-theme="dark"] .rn-header.header--fixed {
  background: linear-gradient(135deg, rgba(31,35,41,.96), rgba(24,28,34,.92)) !important;
  border-bottom: 1px solid rgba(255,255,255,.10) !important;
  box-shadow: 0 12px 35px rgba(0,0,0,.20), inset 0 1px 0 rgba(255,255,255,.04) !important;
}

html[data-theme="light"] .popup-mobile-menu .inner {
  background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(232,238,246,.98)) !important;
  box-shadow: 18px 0 55px rgba(31,49,78,.16) !important;
}

html[data-theme="light"] .rn-footer-area {
  background: linear-gradient(145deg, #e6edf5, #f5f8fb) !important;
  border-top: 1px solid rgba(24,37,58,.10);
}

html[data-theme="dark"] .popup-mobile-menu .inner {
  background: linear-gradient(145deg, #21262d, #171b21) !important;
}

@media (prefers-reduced-transparency: reduce) {
  html[data-theme="light"] .rn-header.header--fixed,
  html[data-theme="dark"] .rn-header.header--fixed { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
