:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #eef3f9;
  --ink: #14213d;
  --muted: #5f6b7a;
  --line: #d9e1ec;
  --primary: #174ea6;
  --primary-dark: #103873;
  --success: #176b45;
  --warning: #8b5a00;
  --danger: #9f2d2d;
  --shadow: 0 18px 48px rgba(28, 48, 78, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  background:
    radial-gradient(circle at 10% -10%, rgba(23, 78, 166, 0.11), transparent 33rem),
    var(--bg);
  color: var(--ink);
  margin: 0;
  min-height: 100vh;
}

a { color: inherit; }

button,
input { font: inherit; }

button,
a.workspace-action { -webkit-tap-highlight-color: transparent; }

.shell {
  margin: 0 auto;
  max-width: 1180px;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.skip-link {
  background: var(--ink);
  color: #fff;
  left: 1rem;
  padding: 0.7rem 1rem;
  position: fixed;
  top: -5rem;
  z-index: 100;
}

.skip-link:focus { top: 1rem; }

.portal-header {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.header-row,
.footer-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 76px;
}

.portal-brand {
  align-items: center;
  display: inline-flex;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--primary);
  border-radius: 13px;
  box-shadow: 0 8px 20px rgba(23, 78, 166, 0.22);
  color: #fff;
  display: inline-flex;
  font-size: 1.2rem;
  font-weight: 800;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.portal-brand strong,
.portal-brand small { display: block; }

.portal-brand strong { font-size: 1rem; }

.portal-brand small {
  color: var(--muted);
  font-size: 0.77rem;
  margin-top: 0.15rem;
}

.security-note {
  color: var(--success);
  font-size: 0.86rem;
  font-weight: 700;
}

.hero {
  align-items: center;
  display: grid;
  gap: 3rem;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, 0.75fr);
  padding-bottom: 3.75rem;
  padding-top: 4.5rem;
}

.eyebrow {
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 0 0 0.65rem;
  text-transform: uppercase;
}

h1,
h2,
h3,
p { overflow-wrap: anywhere; }

h1 {
  font-size: clamp(2.15rem, 5vw, 4.4rem);
  letter-spacing: -0.045em;
  line-height: 1.02;
  margin: 0;
  max-width: 15ch;
}

.hero-text {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
  margin: 1.25rem 0 0;
  max-width: 64ch;
}

.workspace-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.workspace-form label,
.search-box span {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.input-row {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

input {
  background: #fff;
  border: 1px solid #b9c5d6;
  border-radius: 10px;
  color: var(--ink);
  min-height: 46px;
  outline: none;
  padding: 0.65rem 0.8rem;
  width: 100%;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 78, 166, 0.14);
}

button,
.workspace-action {
  align-items: center;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 46px;
  padding: 0.65rem 1.05rem;
  text-decoration: none;
}

button:hover,
.workspace-action:hover { background: var(--primary-dark); }

button:focus-visible,
.workspace-action:focus-visible {
  outline: 3px solid rgba(23, 78, 166, 0.24);
  outline-offset: 3px;
}

.form-message {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  margin: 0.8rem 0 0;
}

.form-message.error { color: var(--danger); }
.form-message.success { color: var(--success); }

.workspace-section { padding-bottom: 5rem; }

.section-heading {
  align-items: end;
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

h2 {
  font-size: 1.9rem;
  letter-spacing: -0.025em;
  margin: 0;
}

.search-box { width: min(310px, 100%); }

.search-box input { min-height: 42px; }

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

.workspace-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(28, 48, 78, 0.06);
  display: flex;
  flex-direction: column;
  min-height: 230px;
  padding: 1.25rem;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.workspace-card:hover {
  box-shadow: 0 14px 35px rgba(28, 48, 78, 0.11);
  transform: translateY(-2px);
}

.workspace-card.maintenance { background: #fffaf0; }

.card-top {
  align-items: center;
  display: flex;
  gap: 0.8rem;
  justify-content: space-between;
}

.workspace-code {
  background: var(--surface-soft);
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  padding: 0.35rem 0.6rem;
  text-transform: uppercase;
}

.status {
  align-items: center;
  color: var(--success);
  display: inline-flex;
  font-size: 0.74rem;
  font-weight: 800;
  gap: 0.35rem;
}

.status::before {
  background: currentColor;
  border-radius: 50%;
  content: "";
  height: 0.48rem;
  width: 0.48rem;
}

.status.maintenance { color: var(--warning); }

.workspace-card h3 {
  font-size: 1.18rem;
  line-height: 1.3;
  margin: 1.05rem 0 0.55rem;
}

.workspace-description {
  color: var(--muted);
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0 0 1.2rem;
}

.workspace-action[aria-disabled="true"] {
  background: #e9edf3;
  border-color: #d5dce6;
  color: #6c7786;
  cursor: not-allowed;
  pointer-events: none;
}

.state-card {
  background: var(--surface);
  border: 1px dashed #b9c5d6;
  border-radius: 14px;
  color: var(--muted);
  padding: 2rem;
  text-align: center;
}

.portal-footer {
  background: var(--ink);
  color: #d9e1ec;
  font-size: 0.82rem;
}

.footer-row { gap: 1rem; }

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; padding-top: 3.25rem; }
  .workspace-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .shell { padding-left: 1rem; padding-right: 1rem; }
  .security-note { display: none; }
  .hero { gap: 2rem; padding-bottom: 3rem; }
  .input-row { grid-template-columns: 1fr; }
  .section-heading { align-items: stretch; flex-direction: column; gap: 1rem; }
  .search-box { width: 100%; }
  .workspace-grid { grid-template-columns: 1fr; }
  .footer-row { align-items: flex-start; flex-direction: column; justify-content: center; padding-bottom: 1rem; padding-top: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
