/* ==========================================================================
   Design tokens (matches the original Tailwind config: primary/secondary
   greens, dark neutral scale, soft shadows, glow effects)
   ========================================================================== */
:root {
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;

  --secondary-400: #38bdf8;
  --secondary-600: #0ea5e9;

  --dark-50: #f8fafc;
  --dark-100: #f1f5f9;
  --dark-200: #e2e8f0;
  --dark-300: #cbd5e1;
  --dark-400: #94a3b8;
  --dark-500: #64748b;
  --dark-600: #475569;
  --dark-700: #334155;
  --dark-800: #1e293b;
  --dark-900: #0f172a;
  --dark-950: #020617;

  --shadow-soft: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow-soft-lg: 0 8px 24px -8px rgba(15,23,42,.12);
  --shadow-glow: 0 0 0 3px rgba(37,99,235,.12);

  --radius-lg: .65rem;
  --radius-xl: .85rem;
  --radius-2xl: 1rem;

  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e5e9f0;
  --nav-bg: rgba(255,255,255,.85);
  --card-bg: #ffffff;
}

html.dark {
  --bg: var(--dark-900);
  --bg-alt: var(--dark-950);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: var(--dark-700);
  --nav-bg: rgba(15,23,42,.8);
  --card-bg: var(--dark-800);
}

/* ==========================================================================
   Base
   ========================================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background .2s ease, color .2s ease;
}
h1,h2,h3,h4,h5,h6 { font-weight: 700; margin: 0; line-height: 1.2; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }

/* ==========================================================================
   Utility helpers
   ========================================================================== */
.gradient-text {
  color: var(--primary-700);
}
html.dark .gradient-text { color: var(--primary-400); }

.badge-pill {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .4rem .85rem; border-radius: 999px;
  background: var(--primary-50); border: 1px solid var(--primary-200);
  color: var(--primary-700); font-size: .8125rem; font-weight: 500;
}
html.dark .badge-pill { background: rgba(37,99,235,.12); border-color: rgba(59,130,246,.25); color: var(--primary-300); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .65rem 1.35rem; border-radius: var(--radius-lg); font-weight: 600; font-size: .9rem;
  border: 1px solid transparent; cursor: pointer; transition: all .15s ease;
}
.btn-gradient {
  color: #fff;
  background: var(--primary-600);
}
.btn-gradient:hover { background: var(--primary-700); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary-500); color: var(--primary-600); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-alt); color: var(--text); }
.btn-lg { padding: .85rem 1.75rem; font-size: 1rem; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 1.5rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.card-hover:hover { box-shadow: var(--shadow-soft-lg); border-color: var(--primary-300); }

.icon-tile {
  width: 2.75rem; height: 2.75rem; border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-600);
  color: #fff; flex-shrink: 0;
}
.icon-tile svg { width: 1.35rem; height: 1.35rem; }

/* ==========================================================================
   Header / Nav
   ========================================================================== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  border-bottom: 1px solid var(--border);
}
/* backdrop-filter lives on this ::before layer instead of .site-header itself —
   backdrop-filter/filter/transform on an element creates a new positioning
   context for its FIXED-position descendants, which was collapsing the
   mobile nav panel's height down to just the header's own 4rem instead of
   the full screen. Keeping it off .site-header avoids that side effect
   while keeping the same glass-blur look. */
.site-header::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--nav-bg); backdrop-filter: blur(16px);
}
.site-header .container {
  height: 4rem; display: flex; align-items: center; justify-content: space-between;
}
.site-logo { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.1rem; }
.site-logo .icon-tile { width: 2rem; height: 2rem; border-radius: .5rem; }
.site-logo .icon-tile svg { width: 1.1rem; height: 1.1rem; }

.main-nav ul { list-style: none; display: flex; gap: 2rem; margin: 0; padding: 0; }
.main-nav a { color: var(--text-muted); font-weight: 500; transition: color .2s; }
.main-nav a:hover { color: var(--primary-600); }

/* Mega menu ------------------------------------------------------------- */
.main-nav > ul > li { position: relative; }
.main-nav > ul > li.menu-item-has-children > a {
  display: inline-flex; align-items: center; gap: .3rem;
}
.main-nav > ul > li.menu-item-has-children > a::after {
  content: ''; width: .4rem; height: .4rem;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); margin-top: -.2rem; transition: transform .15s ease;
}
.main-nav > ul > li.menu-item-has-children:hover > a::after,
.main-nav > ul > li.menu-item-has-children:focus-within > a::after { transform: rotate(-135deg); margin-top: .2rem; }

.mega-panel {
  position: absolute; top: calc(100% + .75rem); left: 50%; transform: translateX(-50%);
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-soft-lg);
  padding: 1.5rem; width: max-content; min-width: 14rem; max-width: 90vw;
  opacity: 0; visibility: hidden; transform: translateX(-50%) translateY(-.4rem);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
  z-index: 200;
}
.main-nav > ul > li.menu-item-has-children:hover > .mega-panel,
.main-nav > ul > li.menu-item-has-children:focus-within > .mega-panel {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}

.mega-columns { display: flex; align-items: flex-start; gap: 0; }
.mega-col { flex: 1 1 12rem; min-width: 11rem; padding: 0 1.25rem; border-right: 1px solid var(--border); }
.mega-col:first-child { padding-left: 0; }
.mega-col:last-child { border-right: none; }

/* Stacked layout: a single narrow column, one link per row, no side-by-side columns */
.mega-columns-stacked { display: block; }
.mega-columns-stacked .mega-col { flex: none; min-width: 16rem; max-width: 22rem; width: max-content; padding: 0; border-right: none; }
.mega-columns-stacked .mega-item { width: 100%; }

.mega-col-title {
  display: flex; align-items: center; gap: .5rem;
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); margin-bottom: .75rem; text-decoration: none;
}
.mega-col-title-link:hover { color: var(--primary-600); }
.mega-col-title svg { width: 1rem; height: 1rem; flex-shrink: 0; }

.mega-col-links { display: flex; flex-direction: column; gap: .15rem; }
.mega-col-plain { display: flex; flex-direction: column; gap: .15rem; justify-content: center; }

.mega-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem .5rem; border-radius: var(--radius-lg);
  text-decoration: none; color: var(--text);
}
.mega-item:hover { background: var(--bg-alt); }
.mega-item-icon {
  width: 2.1rem; height: 2.1rem; border-radius: .6rem; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-50); color: var(--primary-600);
}
html.dark .mega-item-icon { background: rgba(37,99,235,.15); }
.mega-item-icon svg { width: 1.1rem; height: 1.1rem; }
.mega-item-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.mega-item-title { font-weight: 600; font-size: .9rem; }
.mega-item-desc { font-size: .78rem; color: var(--text-muted); }

.mega-widget-panel {
  flex: 1 1 14rem; min-width: 13rem; padding-left: 1.25rem;
}
.mega-widget-item h4 { font-size: .85rem; margin: .75rem 0 .25rem; }
.mega-widget-item img { border-radius: var(--radius-lg); }

.header-actions { display: flex; align-items: center; gap: .5rem; }
.theme-toggle {
  width: 2.25rem; height: 2.25rem; border-radius: .6rem; border: none;
  background: transparent; color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { background: var(--bg-alt); }
.nav-toggle { display: none; background: none; border: none; color: var(--text); cursor: pointer; }

body { padding-top: 4rem; }
body.aiap-app { padding-top: 0; }

@media (max-width: 860px) {
  .main-nav {
    position: fixed; top: 4rem; left: 0; bottom: 0; width: 20rem; max-width: 85vw;
    background: var(--card-bg); border-right: 1px solid var(--border);
    padding: 1.25rem 1.25rem 2rem; overflow-y: auto;
    z-index: 60; transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: var(--shadow-soft-lg);
  }
  .main-nav.open { transform: translateX(0); }
  .main-nav ul { flex-direction: column; gap: 1rem; }
  .nav-toggle { display: inline-flex; }

  .nav-overlay { display: none; position: fixed; inset: 4rem 0 0 0; background: rgba(0,0,0,.4); z-index: 50; }
  .nav-overlay.open { display: block; }

  /* Mega menu becomes a plain stacked block on mobile — no hover, no absolute positioning */
  .main-nav > ul > li.menu-item-has-children > a::after { transform: rotate(45deg) !important; }
  .mega-panel {
    position: static; transform: none !important; opacity: 1; visibility: visible;
    box-shadow: none; border: none; padding: .5rem 0 .5rem 1rem; width: 100%; min-width: 0; max-width: none;
    display: none;
  }
  .main-nav > ul > li.menu-item-has-children.aiap-mobile-open > .mega-panel { display: block; }
  .mega-columns { flex-direction: column; gap: 1.25rem; }
  .mega-col, .mega-columns-stacked .mega-col { border-right: none; padding: 0; min-width: 0; max-width: none; width: auto; }
  .mega-widget-panel { padding-left: 0; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(ellipse at top, rgba(37,99,235,.08), transparent 60%), var(--bg);
  padding: 5rem 0 4rem;
  text-align: center;
}
.hero-inner { max-width: 860px; margin: 0 auto; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.75rem); margin: 1.5rem 0 1.25rem; letter-spacing: -.02em; }
.hero .lead { font-size: 1.25rem; color: var(--text-muted); max-width: 46rem; margin: 0 auto 2rem; line-height: 1.6; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin-bottom: 2rem; }
.trust-row { display: flex; flex-wrap: wrap; gap: 1.25rem; justify-content: center; color: var(--text-muted); font-size: .875rem; margin-bottom: 1.5rem; }
.trust-row span { display: inline-flex; align-items: center; gap: .4rem; }
.kbd-pill { display: inline-flex; align-items: center; gap: .6rem; padding: .6rem 1.1rem; border-radius: var(--radius-lg); background: var(--primary-50); border: 1px solid var(--primary-200); color: var(--primary-700); font-weight: 500; font-size: .875rem; }
html.dark .kbd-pill { background: rgba(37,99,235,.12); border-color: rgba(59,130,246,.3); color: var(--primary-300); }
kbd { background: var(--card-bg); border: 1px solid var(--primary-400); border-radius: .4rem; padding: .2rem .5rem; font-family: monospace; font-size: .8rem; }

/* ==========================================================================
   Section layout
   ========================================================================== */
.section { padding: 5rem 0; }
.section-alt { background: var(--bg-alt); }
.section-header { text-align: center; direction: rtl; max-width: 42rem; margin: 0 auto 3rem; }
.section-header h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); margin-bottom: 1rem; }
.section-header p { color: var(--text-muted); font-size: 1.15rem; }

/* Single post / page title block — full width, no centered 42rem box (unlike .section-header above) */
.entry-header { direction: rtl; margin-bottom: 1.5rem; }
.entry-header h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); margin-top: 1rem; }

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.feature-card h3, .feature-card h4 { margin-bottom: .5rem; font-size: 1.15rem; }
.feature-card p { color: var(--text-muted); font-size: .95rem; }
.feature-card { display: flex; gap: 1rem; align-items: flex-start; }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; max-width: 50rem; margin: 3rem auto 0; text-align: center; }
.stats-row strong { display: block; font-size: 2.25rem; margin-bottom: .25rem; }
.stats-row span { color: var(--text-muted); font-size: .875rem; }
@media (max-width: 640px) { .stats-row { grid-template-columns: repeat(2,1fr); } }

/* ==========================================================================
   Pricing
   ========================================================================== */
.pricing-card { position: relative; text-align: left; }
.pricing-card.popular { border: 2px solid var(--primary-600); box-shadow: var(--shadow-soft-lg); }
.pricing-badge { position: absolute; top: -1rem; left: 50%; transform: translateX(-50%); background: linear-gradient(90deg, var(--primary-600), var(--secondary-600)); color: #fff; font-size: .8rem; font-weight: 600; padding: .35rem .9rem; border-radius: 999px; }
.price { font-size: 2.25rem; font-weight: 800; }
.price span { font-size: 1rem; font-weight: 500; color: var(--text-muted); }
.pricing-features { list-style: none; margin: 1.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .65rem; }
.pricing-features li { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; color: var(--text-muted); }
.pricing-features li::before { content: "✓"; color: var(--primary-600); font-weight: 700; }

.faq-item { padding: 1.5rem; }
.faq-item h4 { margin-bottom: .5rem; }
.faq-item p { color: var(--text-muted); font-size: .9rem; }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.form-field { margin-bottom: 1rem; }
.form-field label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .4rem; }
.form-field input, .form-field textarea {
  width: 100%; padding: .7rem 1rem; border-radius: .8rem; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-family: inherit; font-size: .95rem;
}
.form-field input:focus, .form-field textarea:focus { outline: none; border-color: var(--primary-500); box-shadow: 0 0 0 3px rgba(74,222,128,.2); }
.contact-info-card { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
.contact-info-card h4 { margin-bottom: .25rem; }
.contact-info-card p { color: var(--text-muted); font-size: .9rem; }

/* ==========================================================================
   Final CTA
   ========================================================================== */
.final-cta { text-align: center; background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.checklist { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; margin: 2rem 0; }
.checklist span { display: inline-flex; align-items: center; gap: .5rem; color: var(--text-muted); }
.checklist svg { color: var(--primary-600); width: 1.1rem; height: 1.1rem; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 2rem; padding: 3rem 0; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: repeat(2,1fr); } }
.footer-grid h4 { margin-bottom: 1rem; font-size: .95rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.footer-grid a { color: var(--text-muted); font-size: .9rem; }
.footer-grid a:hover { color: var(--primary-600); }
.footer-bottom { border-top: 1px solid var(--border); padding: 1.5rem 0; text-align: center; color: var(--text-muted); font-size: .85rem; }

/* Widget-friendly defaults so WP widgets don't break the layout */
.footer-grid .widget ul { list-style: none; margin: 0; padding: 0; }

/* ==========================================================================
   Post / page content typography (the_content output)
   ========================================================================== */
.page-content { color: var(--text); line-height: 1.75; font-size: 1.05rem; direction: rtl; text-align: right; }
.page-content * { direction: inherit; } /* overrides any leftover ltr the block editor may have saved per-block */
.page-content h1, .page-content h2, .page-content h3, .page-content h4 { margin: 0; }
.page-content p { margin-bottom: 1.25rem; }
.page-content a:not(.btn) { color: var(--primary-600); text-decoration: underline; }
.page-content img { border-radius: var(--radius-xl); margin: 1.5rem 0; max-width: 100%; height: auto; }
.page-content ul, .page-content ol { margin: 0 0 1.25rem; padding-inline-start: 1.5rem; padding-inline-end: 0; }
.page-content li { margin-bottom: .4rem; }
.page-content blockquote { border-inline-start: 3px solid var(--primary-500); border-inline-end: none; padding-inline-start: 1rem; padding-inline-end: 0; color: var(--text-muted); font-style: italic; margin: 1.5rem 0; }
.page-content code { background: var(--bg-alt); padding: .15rem .4rem; border-radius: .4rem; font-size: .9em; }
.page-content pre { background: var(--bg-alt); border-radius: var(--radius-lg); padding: 1.25rem; overflow-x: auto; margin: 1.5rem 0; }
.page-content pre code { background: none; padding: 0; }
.page-content hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.page-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.page-content th, .page-content td { border: 1px solid var(--border); padding: .6rem .9rem; text-align: start; }
.page-content th { background: var(--bg-alt); font-weight: 600; }
.page-content figure { margin: 1.5rem 0; }
.page-content figcaption { color: var(--text-muted); font-size: .85rem; margin-top: .5rem; text-align: center; }
.page-content .wp-block-columns { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.page-content .wp-block-column { flex: 1 1 0; min-width: 0; }
.page-content .wp-block-button__link { display: inline-block; padding: .65rem 1.35rem; border-radius: var(--radius-lg); background: var(--primary-600); color: #fff; text-decoration: none; font-weight: 600; }
.page-content .wp-block-button__link:hover { background: var(--primary-700); }

/* ==========================================================================
   Single post: meta row, tags, author box, related posts
   ========================================================================== */
.single-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 1rem 0 1.5rem; color: var(--text-muted); font-size: .9rem; }
.single-meta-row .badge-pill { font-size: .8rem; }
.single-meta-author { display: flex; align-items: center; gap: .5rem; }
.single-meta-author img { border-radius: 50%; }
.single-cats { display: flex; flex-wrap: wrap; gap: .5rem; }
.single-cats a { display: inline-block; padding: .3rem .75rem; border-radius: 999px; background: var(--primary-50); color: var(--primary-700); font-size: .8rem; text-decoration: none; }
html.dark .single-cats a { background: rgba(37,99,235,.15); color: var(--primary-300); }

.single-tags { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 2rem 0; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.single-tags a { display: inline-block; padding: .3rem .75rem; border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted); font-size: .8rem; text-decoration: none; }
.single-tags a:hover { border-color: var(--primary-500); color: var(--primary-600); }

.author-box { display: flex; gap: 1.25rem; align-items: flex-start; margin: 2.5rem 0; padding: 1.75rem; }
.author-box img { border-radius: 50%; flex-shrink: 0; }
.author-box h4 { margin-bottom: .4rem; }
.author-box p { color: var(--text-muted); font-size: .9rem; margin: 0; }

.related-posts-title { font-size: 1.2rem; margin: 2.5rem 0 1.25rem; }
.related-post-card { display: block; text-decoration: none; color: var(--text); }
.related-post-card img { border-radius: var(--radius-lg); margin-bottom: .75rem; aspect-ratio: 16/10; object-fit: cover; }
.related-post-card h5 { font-size: .95rem; font-weight: 600; margin-bottom: .3rem; }
.related-post-card span { color: var(--text-muted); font-size: .8rem; }

/* ==========================================================================
   Auth pages (login / register / forgot password)
   ========================================================================== */
.auth-shell {
  min-height: calc(100vh - 4rem);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1.25rem;
  background: linear-gradient(135deg, var(--primary-50), var(--bg) 55%, var(--primary-50));
}
html.dark .auth-shell { background: linear-gradient(135deg, var(--dark-950), var(--dark-900) 55%, var(--dark-950)); }
.auth-box { width: 100%; max-width: 26rem; }
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo .icon-tile { width: 2.75rem; height: 2.75rem; border-radius: .85rem; margin: 0 auto .75rem; }
.auth-logo .icon-tile svg { width: 1.5rem; height: 1.5rem; }
.auth-logo p { color: var(--text-muted); font-size: .875rem; margin-top: .35rem; }
.auth-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-2xl); box-shadow: var(--shadow-soft-lg); padding: 2rem; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: .4rem; }
.auth-card .auth-sub { color: var(--text-muted); margin-bottom: 1.5rem; }
.auth-footnote { text-align: center; font-size: .875rem; color: var(--text-muted); margin-top: 1.5rem; }
.auth-footnote a { color: var(--primary-600); font-weight: 600; }
.auth-row { display: flex; align-items: center; justify-content: space-between; font-size: .875rem; margin: .25rem 0 1.25rem; }
.auth-row label { display: flex; align-items: center; gap: .5rem; cursor: pointer; color: var(--text-muted); }
.auth-alert { padding: .8rem 1rem; border-radius: .8rem; font-size: .875rem; margin-bottom: 1.25rem; }
.auth-alert.error { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.auth-alert.success { background: var(--primary-100); color: var(--primary-800); border: 1px solid var(--primary-300); }
html.dark .auth-alert.error { background: rgba(185,28,28,.15); border-color: rgba(185,28,28,.35); color: #fca5a5; }
html.dark .auth-alert.success { background: rgba(37,99,235,.18); border-color: rgba(59,130,246,.35); color: var(--primary-300); }
.btn-block { width: 100%; }
.field-icon-wrap { position: relative; }
.field-icon-wrap svg { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.field-icon-wrap input { padding-left: 2.75rem; }

/* ==========================================================================
   Dashboard (logged-in user panel)
   ========================================================================== */
.dash-wrap { display: flex; min-height: calc(100vh - 4rem); align-items: stretch; }

.dash-sidebar {
  width: 16rem; flex-shrink: 0;
  background: var(--card-bg); border-right: 1px solid var(--border);
  padding: 1.25rem .9rem;
}
.dash-sidebar .dash-brand { display:flex; align-items:center; gap:.6rem; padding: .5rem .4rem 1.25rem; }
.dash-nav { display: flex; flex-direction: column; gap: .25rem; }
.dash-nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 700; margin: 1rem .6rem .4rem; }
.dash-nav a {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem .8rem; border-radius: .75rem; color: var(--text-muted); font-weight: 500; font-size: .92rem;
  transition: all .15s ease;
}
.dash-nav a:hover { background: var(--bg-alt); color: var(--text); }
.dash-nav a.active { background: var(--primary-100); color: var(--primary-700); }
html.dark .dash-nav a.active { background: rgba(37,99,235,.18); color: var(--primary-300); }
.dash-nav svg { width: 1.1rem; height: 1.1rem; flex-shrink: 0; }
.dash-nav .badge-new { margin-left: auto; font-size: .65rem; font-weight: 700; background: var(--primary-600); color: #fff; padding: .1rem .4rem; border-radius: .35rem; }

.dash-main { flex: 1; min-width: 0; }
.dash-topbar {
  height: 4rem; display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; border-bottom: 1px solid var(--border); background: var(--card-bg);
}
.dash-user { display: flex; align-items: center; gap: .65rem; position: relative; }
.dash-avatar { width: 2.25rem; height: 2.25rem; border-radius: 50%; overflow: hidden; background: var(--primary-100); }
.dash-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dash-user-menu { display: none; position: absolute; right: 0; top: 3rem; background: var(--card-bg); border: 1px solid var(--border); border-radius: .9rem; box-shadow: var(--shadow-soft-lg); min-width: 12rem; padding: .5rem; z-index: 20; }
.dash-user-menu.open { display: block; }
.dash-user-menu a { display: flex; align-items: center; gap: .6rem; padding: .6rem .7rem; border-radius: .6rem; color: var(--text); font-size: .9rem; }
.dash-user-menu a:hover { background: var(--bg-alt); }

.dash-content { padding: 1.75rem; }
.dash-welcome { margin-bottom: 1.5rem; }
.dash-welcome h1 { font-size: 1.6rem; margin-bottom: .3rem; }
.dash-welcome p { color: var(--text-muted); }

.stat-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 800; margin: .35rem 0 .15rem; }
.stat-card .stat-label { color: var(--text-muted); font-size: .85rem; }

.dash-panel { margin-top: 1.5rem; }
.dash-panel h3 { margin-bottom: 0; font-size: 1.1rem; }
.dash-widget-item { min-width: 0; }
.dash-widget-item > *:last-child { margin-bottom: 0; }
.dash-zone-stack { display: flex; flex-direction: column; gap: 1.5rem; }
.info-list { display: flex; flex-direction: column; }
.info-list li { display: flex; justify-content: space-between; padding: .75rem 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.info-list li:last-child { border-bottom: none; }
.info-list span:first-child { color: var(--text-muted); }
.info-list span:last-child { font-weight: 500; }

@media (max-width: 900px) {
  .dash-sidebar { position: fixed; left: 0; top: 4rem; bottom: 0; z-index: 60; transform: translateX(-100%); transition: transform .2s ease; }
  .dash-sidebar.open { transform: translateX(0); }
  .dash-overlay { display: none; position: fixed; inset: 4rem 0 0 0; background: rgba(0,0,0,.4); z-index: 50; }
  .dash-overlay.open { display: block; }
}

/* Misc */
.mb-0 { margin-bottom: 0 !important; }
.text-center { text-align: center; }

/* ==========================================================================
   Maintenance / "Coming soon" mode
   ========================================================================== */
body.aiap-maintenance {
  margin: 0; padding: 2rem; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at top, rgba(37,99,235,.25), transparent 55%),
              linear-gradient(160deg, var(--dark-950), var(--dark-900) 60%, var(--dark-950));
  font-family: 'Inter', system-ui, sans-serif;
  color: #f8fafc;
  position: relative;
  overflow: hidden;
}
body.aiap-maintenance::before,
body.aiap-maintenance::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(90px); opacity: .35; z-index: 0;
}
body.aiap-maintenance::before { width: 26rem; height: 26rem; background: var(--primary-600); top: -8rem; inset-inline-start: -8rem; }
body.aiap-maintenance::after { width: 22rem; height: 22rem; background: var(--secondary-600); bottom: -6rem; inset-inline-end: -6rem; }

.maintenance-card {
  position: relative; z-index: 1;
  max-width: 34rem; width: 100%; text-align: center;
  background: rgba(15,23,42,.65);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 1.5rem;
  padding: 3rem 2.25rem;
  backdrop-filter: blur(24px);
  box-shadow: 0 25px 70px rgba(0,0,0,.45);
}
.maintenance-logo { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-bottom: 1.75rem; }
.maintenance-card h1 { font-size: 1.85rem; font-weight: 700; margin-bottom: 1rem; letter-spacing: -.01em; }
.maintenance-card p { color: var(--dark-300); line-height: 1.75; margin-bottom: 2rem; font-size: 1rem; }

.maintenance-countdown { display: flex; justify-content: center; gap: .85rem; flex-wrap: wrap; margin-bottom: 2rem; }
.cd-item { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 1rem; padding: 1rem 1.1rem; min-width: 4.75rem; }
.cd-num { display: block; font-size: 1.9rem; font-weight: 800; color: var(--primary-400); font-variant-numeric: tabular-nums; }
.cd-label { display: block; font-size: .7rem; color: var(--dark-400); text-transform: uppercase; letter-spacing: .06em; margin-top: .3rem; }

.maintenance-admin-link { display: inline-block; font-size: .8rem; color: var(--dark-500); text-decoration: none; }
.maintenance-admin-link:hover { color: var(--primary-400); }

/* ==========================================================================
   RTL support (Persian / Arabic / Hebrew etc.)
   WordPress adds dir="rtl" to <html> automatically for RTL locales — most of
   this theme's flexbox/grid layouts already mirror correctly on their own,
   these overrides only cover the spots that use explicit left/right values.
   ========================================================================== */
html[dir="rtl"] .field-icon-wrap svg { left: auto; right: 1rem; }
html[dir="rtl"] .field-icon-wrap input { padding-left: 1rem; padding-right: 2.75rem; }

html[dir="rtl"] .stat-card { flex-direction: row-reverse; justify-content: flex-end; }

html[dir="rtl"] .mega-col { border-right: none; border-left: 1px solid var(--border); }
html[dir="rtl"] .mega-col:first-child { padding-right: 0; padding-left: 1.25rem; }
html[dir="rtl"] .mega-col:last-child { border-left: none; }
html[dir="rtl"] .mega-widget-panel { padding-left: 0; padding-right: 1.25rem; }

html[dir="rtl"] .dash-user-menu { right: auto; left: 0; }

html[dir="rtl"] .dash-sidebar { border-right: none; border-left: 1px solid var(--border); }

html[dir="rtl"] .main-nav { border-right: none; border-left: 1px solid var(--border); }

html[dir="rtl"] .kbd-pill kbd { font-family: 'Inter', monospace; }

@media (max-width: 900px) {
  html[dir="rtl"] .dash-sidebar { left: auto; right: 0; transform: translateX(100%); }
  html[dir="rtl"] .dash-sidebar.open { transform: translateX(0); }
}

@media (max-width: 860px) {
  html[dir="rtl"] .main-nav { left: auto; right: 0; transform: translateX(100%); }
  html[dir="rtl"] .main-nav.open { transform: translateX(0); }
}

html[dir="rtl"] .pricing-badge { left: 50%; transform: translateX(50%); }

/* Icons that imply LTR direction (arrows) should flip so they still point
   "forward" in reading order. */
html[dir="rtl"] .icon-arrow { transform: scaleX(-1); }

/* ==========================================================================
   Third-party plugin isolation
   ========================================================================== */
/* Add any plugin wrapper class here (comma-separated) to fully exclude that
   element from this theme's CSS — useful when a plugin ships its own
   styling and it conflicts with the theme's global rules. `all: revert`
   resets that element's own properties back to the browser default, so the
   plugin's own stylesheet takes over cleanly.
   To add another plugin later, add its wrapper class to the same selector
   list below (e.g. ".ioes-wrap, .another-plugin-class"). */
.ioes-wrap,
.ioes-dash-wrap {
  all: revert !important;
}
.ioes-wrap .card,
.ioes-dash-wrap .card {
  all: revert !important;
}
/* The theme also wraps whole-page plugin content in its own .card box
   (e.g. the "Dashboard Page" template) — when that .card is the OUTER
   parent of the plugin (not a child), :has() selects it from the outside. */
.card:has(.ioes-wrap),
.card:has(.ioes-dash-wrap) {
  all: revert !important;
}

.ioes-wrap{
  all: revert !important;
  margin:0 auto !important;
}
.ioes-dash-wrap {
    all: revert !important;
}
@media screen and (min-width: 960px) {
    .ioes-wrap {
        width: 880px !important;
    }
}
.card.dash-widget-item:has(.ioes-dash-wrap), .card.dash-panel.page-content:has(.ioes-wrap), .card.dash-panel.page-content:has(.ioes-dash-wrap) {
  border: none;
  padding: 0;
  margin: 0;
}
.ioes-dash-row {
    display: flex;
    align-items: stretch;
}
.ioes-dash-col-narrow,
.ioes-dash-col-wide {
    display: flex;
    flex-direction: column;
}
.ioes-dash-col-narrow .ioes-dash-card,
.ioes-dash-col-wide .ioes-dash-card {
    height: 100%;
}
.ioes-stepper {
  margin: 0 !important;
}
.page-content li {
  margin-bottom: 0 !important;
}
.page-content ul, .page-content ol {
  margin: 0 !important;
  padding-inline-start: 0 !important;
}
.ioes-card {
  margin-bottom: 10px !important;
}
.dash-welcome {
  text-align: center;
}
.dash-welcome h1 {
  font-size: 1.6rem;
  margin-bottom: 0;
  padding-bottom: 15px;
  width: max-content;
  margin: 0 auto;
}
