/* EDF brand: orange #FE5716, navy #10367A */
:root,
[data-theme="light"] {
  --edf-orange: #fe5716;
  --edf-navy: #10367a;
  --bg: #f4f6f9;
  --bg-accent: rgba(254, 87, 22, 0.06);
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --surface-hover: #f8fafc;
  --border: #d8e0ea;
  --border-strong: #c5d0de;
  --text: #10367a;
  --muted: #5a6b7d;
  --accent: #fe5716;
  --accent-dim: rgba(254, 87, 22, 0.12);
  --header-bar: #10367a;
  --header-text: #ffffff;
  --shadow: 0 2px 12px rgba(16, 54, 122, 0.08);
  --shadow-hover: 0 8px 24px rgba(16, 54, 122, 0.12);
  --apps-tint: #0284c7;
  --apps-dim: rgba(2, 132, 199, 0.12);
  --linux-tint: #16a34a;
  --linux-dim: rgba(22, 163, 74, 0.12);
  --net-tint: #7c3aed;
  --net-dim: rgba(124, 58, 237, 0.12);
}

[data-theme="dark"] {
  --edf-orange: #fe5716;
  --edf-navy: #10367a;
  --bg: #070f1c;
  --bg-accent: rgba(254, 87, 22, 0.1);
  --surface: #0f2340;
  --surface-elevated: #132d52;
  --surface-hover: #1a3a66;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.22);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #fe5716;
  --accent-dim: rgba(254, 87, 22, 0.2);
  --header-bar: #0c1f3d;
  --header-text: #ffffff;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.45);
  --apps-tint: #38bdf8;
  --apps-dim: rgba(56, 189, 248, 0.16);
  --linux-tint: #4ade80;
  --linux-dim: rgba(74, 222, 128, 0.14);
  --net-tint: #a78bfa;
  --net-dim: rgba(167, 139, 250, 0.16);
}

* { box-sizing: border-box; }

body.edf-portal {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 45% at 100% 0%, var(--bg-accent), transparent),
    radial-gradient(ellipse 50% 35% at 0% 100%, rgba(16, 54, 122, 0.06), transparent);
  color: var(--text);
  transition: background 0.2s, color 0.2s;
}

/* Topbar / brand / nav / theme toggle: see edf-shell-chrome.css */

.edf-main {
  padding: 2rem 1.25rem 3rem;
}

.edf-wrap {
  max-width: 880px;
  margin: 0 auto;
}

.edf-wrap.narrow { max-width: 520px; }

.edf-page-header { margin-bottom: 2rem; }

.edf-page-header h1 {
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.edf-page-header p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  max-width: 36rem;
  line-height: 1.5;
}

.edf-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.edf-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  align-self: stretch;
  min-height: 5.5rem;
  height: auto;
  padding: 1.15rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.edf-card:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  color: inherit;
}

.edf-card-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.edf-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
  overflow: visible;
}

.edf-card-body h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
  line-height: 1.3;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.edf-card-body p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.35;
  display: block;
  overflow: visible;
  overflow-wrap: break-word;
}

.edf-card-arrow {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 1.1rem;
  align-self: center;
  transition: color 0.15s, transform 0.15s;
}

.edf-card:hover .edf-card-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

.edf-group-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 2rem 0 0.75rem;
}

.edf-group-title:first-of-type { margin-top: 0; }

.edf-subgroup-title {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 1.25rem 0 0.65rem;
  opacity: 0.9;
}

.edf-group-title + .edf-subgroup-title {
  margin-top: 0.75rem;
}

/* Root portal: single hero card */
.edf-hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 2.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.edf-hero-card h1 {
  font-size: 1.65rem;
  margin: 0 0 0.5rem;
  font-weight: 700;
  color: var(--text);
}

.edf-hero-card .lead {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

.edf-portal-card {
  display: block;
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.edf-portal-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  color: inherit;
}

.edf-portal-card .icon {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  display: block;
}

.edf-portal-card h2 {
  font-size: 1.2rem;
  margin: 0 0 0.35rem;
  font-weight: 600;
  color: var(--text);
}

.edf-portal-card p {
  font-size: 0.9rem;
  margin: 0;
  color: var(--muted);
}

.edf-signin-card .lead {
  margin-bottom: 1.5rem;
}

.edf-signin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.edf-signin-btn:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
}

.edf-signin-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.edf-signin-hint {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .edf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .edf-grid {
    grid-template-columns: 1fr;
  }
}
