/* GeoArea 4.0 — unified UI foundation
 * Loaded last so it normalizes account, portal, promotion and public surfaces
 * without replacing page-specific layouts.
 */
:root {
  --gh4-primary: var(--ga-primary, #0f2f57);
  --gh4-primary-strong: #0a2342;
  --gh4-accent: var(--ga-accent, #c59a43);
  --gh4-bg: #f5f7fb;
  --gh4-surface: #ffffff;
  --gh4-surface-soft: #f8fafc;
  --gh4-text: #172033;
  --gh4-muted: #64748b;
  --gh4-border: #e2e8f0;
  --gh4-success: #16825d;
  --gh4-danger: #c63d4f;
  --gh4-warning: #b7791f;
  --gh4-radius-sm: 10px;
  --gh4-radius: 16px;
  --gh4-radius-lg: 22px;
  --gh4-shadow-sm: 0 6px 18px rgba(15, 47, 87, .07);
  --gh4-shadow: 0 14px 36px rgba(15, 47, 87, .10);
  --gh4-focus: 0 0 0 3px rgba(197, 154, 67, .24);
  --gh4-container: 1440px;
}

html { scroll-behavior: smooth; }
body.geoarea-standalone-theme {
  color: var(--gh4-text);
  background: var(--gh4-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Global container rhythm */
.ga-container,
.ga-page-container,
.ga-account-shell,
.ga-owner-portal,
.ga-agency-page,
.ga-promotion-page,
.ga-notifications-page {
  width: min(calc(100% - 32px), var(--gh4-container));
  margin-inline: auto;
}

/* Unified surfaces */
.ga-card,
.ga-panel,
.ga-account-card,
.ga-dashboard-card,
.ga-stat-card,
.ga-owner-card,
.ga-agency-card,
.ga-promotion-card,
.ga-notification-card,
.ga-wallet-card,
.ga-profile-card,
.ga-settings-card,
.ga-table-wrap,
.ga-empty-state {
  background: var(--gh4-surface);
  border: 1px solid var(--gh4-border);
  border-radius: var(--gh4-radius);
  box-shadow: var(--gh4-shadow-sm);
}

/* Headings */
body.geoarea-standalone-theme h1,
body.geoarea-standalone-theme h2,
body.geoarea-standalone-theme h3,
body.geoarea-standalone-theme h4 {
  color: var(--gh4-text);
  letter-spacing: -.018em;
}
.ga-page-title,
.ga-account-title,
.ga-section-title {
  margin: 0;
  font-weight: 850;
  line-height: 1.18;
}
.ga-page-subtitle,
.ga-muted,
.ga-help,
.ga-description { color: var(--gh4-muted); }

/* Buttons and links */
.ga-btn,
.ga-button,
button.ga-btn,
a.ga-btn,
input[type="submit"].ga-btn,
.wp-element-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--gh4-radius-sm);
  background: var(--gh4-primary);
  color: #fff;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease;
}
.ga-btn:hover,
.ga-button:hover,
a.ga-btn:hover,
button.ga-btn:hover {
  background: var(--gh4-primary-strong);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--gh4-shadow-sm);
}
.ga-btn:focus-visible,
.ga-button:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--gh4-focus);
}
.ga-btn--secondary,
.ga-btn-secondary,
.ga-button-secondary {
  background: var(--gh4-surface);
  color: var(--gh4-primary);
  border-color: var(--gh4-border);
}
.ga-btn--secondary:hover,
.ga-btn-secondary:hover,
.ga-button-secondary:hover {
  background: var(--gh4-surface-soft);
  color: var(--gh4-primary-strong);
  border-color: #cbd5e1;
}
.ga-btn--danger,
.ga-btn-danger { background: var(--gh4-danger); }
.ga-btn--accent,
.ga-btn-accent { background: var(--gh4-accent); color: #fff; }

/* Forms */
body.geoarea-standalone-theme input[type="text"],
body.geoarea-standalone-theme input[type="email"],
body.geoarea-standalone-theme input[type="tel"],
body.geoarea-standalone-theme input[type="number"],
body.geoarea-standalone-theme input[type="password"],
body.geoarea-standalone-theme input[type="search"],
body.geoarea-standalone-theme input[type="url"],
body.geoarea-standalone-theme input[type="date"],
body.geoarea-standalone-theme input[type="time"],
body.geoarea-standalone-theme select,
body.geoarea-standalone-theme textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--gh4-border);
  border-radius: var(--gh4-radius-sm);
  background: var(--gh4-surface);
  color: var(--gh4-text);
  padding: 11px 13px;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
body.geoarea-standalone-theme textarea { min-height: 120px; resize: vertical; }
body.geoarea-standalone-theme input:focus,
body.geoarea-standalone-theme select:focus,
body.geoarea-standalone-theme textarea:focus {
  border-color: var(--gh4-accent);
  box-shadow: var(--gh4-focus);
}
body.geoarea-standalone-theme label {
  color: var(--gh4-text);
  font-weight: 700;
}

/* Tables */
body.geoarea-standalone-theme table { border-collapse: separate; border-spacing: 0; width: 100%; }
body.geoarea-standalone-theme th {
  color: var(--gh4-muted);
  background: var(--gh4-surface-soft);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}
body.geoarea-standalone-theme th,
body.geoarea-standalone-theme td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--gh4-border);
}
body.geoarea-standalone-theme tbody tr:last-child td { border-bottom: 0; }

/* Account shell consistency */
.ga-account-shell,
.ga-owner-portal,
.ga-agency-page,
.ga-promotion-page,
.ga-notifications-page {
  padding-block: clamp(22px, 4vw, 48px);
}
.ga-account-layout,
.ga-dashboard-layout {
  gap: 24px;
}
.ga-account-sidebar,
.ga-dashboard-sidebar {
  border: 1px solid var(--gh4-border);
  border-radius: var(--gh4-radius);
  background: var(--gh4-surface);
  box-shadow: var(--gh4-shadow-sm);
  overflow: hidden;
}
.ga-account-sidebar a,
.ga-dashboard-sidebar a {
  color: var(--gh4-text);
  border-radius: 9px;
}
.ga-account-sidebar a:hover,
.ga-dashboard-sidebar a:hover,
.ga-account-sidebar a.is-active,
.ga-dashboard-sidebar a.is-active,
.ga-account-sidebar .active > a,
.ga-dashboard-sidebar .active > a {
  color: var(--gh4-primary);
  background: rgba(15, 47, 87, .08);
}

/* Status badges */
.ga-badge,
.ga-status,
.ga-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}
.ga-badge--success,.ga-status--active { background: #e8f7f1; color: var(--gh4-success); }
.ga-badge--warning,.ga-status--pending { background: #fff7e6; color: var(--gh4-warning); }
.ga-badge--danger,.ga-status--blocked { background: #fff0f2; color: var(--gh4-danger); }

/* Empty states */
.ga-empty-state {
  padding: clamp(28px, 6vw, 64px) 24px;
  text-align: center;
  color: var(--gh4-muted);
}

/* Gentle motion with reduced-motion support */
.ga-card,
.ga-account-card,
.ga-dashboard-card,
.ga-owner-card,
.ga-agency-card,
.ga-promotion-card,
.ga-notification-card {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
@media (hover: hover) {
  .ga-card:hover,
  .ga-account-card:hover,
  .ga-dashboard-card:hover,
  .ga-owner-card:hover,
  .ga-agency-card:hover,
  .ga-promotion-card:hover,
  .ga-notification-card:hover {
    transform: translateY(-2px);
    border-color: #d5dde8;
    box-shadow: var(--gh4-shadow);
  }
}

/* Mobile polish */
@media (max-width: 820px) {
  :root { --gh4-radius: 14px; --gh4-radius-lg: 18px; }
  .ga-container,
  .ga-page-container,
  .ga-account-shell,
  .ga-owner-portal,
  .ga-agency-page,
  .ga-promotion-page,
  .ga-notifications-page {
    width: min(calc(100% - 20px), var(--gh4-container));
  }
  .ga-account-shell,
  .ga-owner-portal,
  .ga-agency-page,
  .ga-promotion-page,
  .ga-notifications-page { padding-block: 16px 92px; }
  .ga-btn,
  .ga-button,
  button.ga-btn,
  a.ga-btn { min-height: 46px; }
  body.geoarea-standalone-theme th,
  body.geoarea-standalone-theme td { padding: 11px 10px; }
}

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