:root {
  --bg: #d8ebf6;
  --bg-accent: #eef6fb;
  --surface: rgba(255, 255, 255, 0.96);
  --surface-soft: rgba(255, 255, 255, 0.9);
  --text: #191919;
  --muted: #54595f;
  --line: rgba(25, 25, 25, 0.12);
  --primary: #f9793e;
  --primary-hover: #de652d;
  --secondary: #d4e5f1;
  --accent: #1ca3dd;
  --danger: #a12424;
  --shadow: 0 24px 56px rgba(16, 47, 71, 0.18);
  --radius-lg: 28px;
  --radius-md: 18px;
  --portal-bg: #49a6ef;
  --portal-panel-surface: #ffffff;
  --portal-title: #ffffff;
  --portal-copy: #122a3d;
  --portal-input-border: #2e5169;
  --portal-button: #349be7;
  --portal-button-hover: #258fe0;
  --portal-button-text: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Roboto", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.9)),
    linear-gradient(135deg, rgba(28, 163, 221, 0.12), rgba(249, 121, 62, 0.1)),
    url("https://devibm.center.xpertus-hosting.de/wp-content/uploads/Wasser_4k-scaled.jpg") center / cover fixed;
}

body.portal-home {
  display: flex;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--portal-bg);
}

a, button, input { font: inherit; }
a { color: inherit; }

.portal-shell {
  width: min(920px, 100%);
  display: grid;
  justify-items: center;
  gap: 28px;
  padding: 20px 0;
}

.portal-intro {
  display: grid;
  gap: 16px;
  justify-items: center;
  text-align: center;
}

.portal-company {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-intro h1 {
  max-width: none;
  color: var(--portal-title);
  font-size: clamp(2.5rem, 4vw, 3.75rem);
  font-weight: 700;
  line-height: 1.08;
}

.portal-subtitle {
  margin: 0;
  color: var(--portal-copy);
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  line-height: 1.45;
  max-width: 34ch;
}

.portal-panel {
  width: min(560px, 100%);
  padding: 42px 28px 32px;
  background: var(--portal-panel-surface);
  border-radius: 42px;
  box-shadow: 0 18px 34px rgba(10, 42, 66, 0.16);
}

.portal-form {
  display: grid;
  gap: 22px;
}

.portal-row {
  display: grid;
  grid-template-columns: minmax(180px, 210px) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.portal-row span {
  color: var(--portal-copy);
  font-size: clamp(1.65rem, 2vw, 1.95rem);
  font-weight: 400;
}

.portal-row input {
  width: 100%;
  height: 42px;
  border: 2px solid var(--portal-input-border);
  border-radius: 9px;
  padding: 8px 14px;
  background: #ffffff;
  color: var(--portal-copy);
  box-shadow: none;
}

.portal-row input:focus {
  border-color: #1e6ca8;
  box-shadow: 0 0 0 4px rgba(52, 155, 231, 0.14);
}

.portal-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 12px;
}

.portal-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 264px;
  padding: 10px 26px;
  border: 2px solid var(--portal-input-border);
  border-radius: 9px;
  background: var(--portal-button);
  color: var(--portal-button-text);
  font-size: 1.15rem;
  font-weight: 500;
  box-shadow: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.portal-submit:hover {
  background: var(--portal-button-hover);
  transform: translateY(-1px);
}

.portal-feedback {
  min-height: 1.6rem;
}

.portal-feedback .message {
  margin: 0;
  color: var(--danger);
  font-size: 0.98rem;
}

.portal-feedback .is-success {
  color: #0f6a37;
}

.page-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.narrow-shell { width: min(560px, calc(100% - 32px)); }

.hero, .dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  padding: 18px 24px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.brand-logo {
  width: min(320px, 52vw);
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.brand-copy { display: grid; gap: 6px; }

.eyebrow, .section-tag {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand-copy .eyebrow {
  margin: 0;
  color: var(--muted);
}

.hero-text, .message, .contact-block, th, td { color: var(--muted); }

h1, h2 { margin: 0; line-height: 1.08; }
h1 { font-size: clamp(2rem, 4vw, 3.3rem); max-width: 14ch; font-weight: 700; }
h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 600; }

.hero-text { margin: 16px 0 0; max-width: 58ch; line-height: 1.7; }
.layout, .dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; }
.layout > *,
.dashboard-grid > * { min-width: 0; }

.card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.portal-card, .info-card, .login-card, .admin-card, .table-card { padding: 28px; }
.portal-card {
  position: relative;
  overflow: hidden;
}

.info-card { align-self: start; }

.portal-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: linear-gradient(180deg, var(--accent), var(--primary));
}

.card-header {
  margin-bottom: 22px;
  padding-left: 10px;
}

.portal-card .card-header,
.portal-card .stack {
  position: relative;
  z-index: 1;
}

.portal-card h1 {
  max-width: none;
  overflow-wrap: anywhere;
}

.portal-title {
  display: grid;
  gap: 0;
  line-height: 0.95;
}

.portal-title span {
  display: block;
}

.stack, .field { display: grid; gap: 18px; }
.field { gap: 8px; }
.field span {
  font-weight: 700;
  color: var(--text);
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  background: var(--surface-soft);
  color: var(--text);
  outline: none;
}

input:focus {
  border-color: rgba(28, 163, 221, 0.52);
  box-shadow: 0 0 0 5px rgba(28, 163, 221, 0.14);
}

.primary-button, .secondary-button, .admin-link, .inline-button {
  border: none;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
  padding: 15px 22px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.primary-button, .admin-link {
  background: var(--primary);
  color: #ffffff;
}

.primary-button:hover, .admin-link:hover { background: var(--primary-hover); }

.secondary-button, .inline-button:not(.primary-button) {
  background: var(--secondary);
  color: var(--text);
}

.secondary-button:hover, .inline-button:not(.primary-button):hover {
  background: #bfd6e6;
  transform: translateY(-1px);
}

.primary-button:hover, .admin-link:hover { transform: translateY(-1px); }

.contact-block p { margin: 0 0 8px; }
.message { min-height: 1.4em; margin: 0; font-size: 0.95rem; }
.is-error { color: var(--danger); }
.is-success { color: var(--accent); }

.login-card h1 { max-width: none; margin-bottom: 10px; font-size: clamp(1.8rem, 4vw, 2.8rem); }

.dashboard-actions, .button-row, .table-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.82);
}

.project-table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td {
  padding: 15px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th { color: var(--text); font-size: 0.92rem; }
.text-link, .project-table a { color: var(--primary); text-decoration: none; font-weight: 700; }
.text-button { border: none; background: transparent; padding: 0; color: var(--primary); cursor: pointer; font-weight: 700; }
.text-button.delete { color: var(--danger); }

@media (max-width: 920px) {
  .portal-shell {
    width: min(680px, 100%);
    gap: 24px;
  }

  .portal-intro h1 {
    font-size: clamp(2.15rem, 7vw, 3rem);
  }

  .portal-subtitle {
    font-size: 1.08rem;
  }

  .portal-panel {
    width: min(520px, 100%);
    padding: 34px 24px 28px;
    border-radius: 34px;
  }

  .portal-row {
    grid-template-columns: minmax(150px, 180px) minmax(0, 1fr);
    gap: 14px;
  }

  .portal-row span {
    font-size: 1.35rem;
  }

  .layout, .dashboard-grid { grid-template-columns: 1fr; }
  .hero, .dashboard-header { flex-direction: column; }
  .hero { align-items: stretch; }
}

@media (max-width: 620px) {
  body.portal-home {
    align-items: flex-start;
    justify-content: center;
    padding: 18px 14px 24px;
  }

  .portal-shell {
    width: min(100%, 420px);
    gap: 18px;
    padding: 8px 0;
  }

  .portal-intro {
    width: 100%;
    gap: 12px;
    justify-items: center;
    text-align: center;
  }

  .portal-intro h1 {
    font-size: clamp(1.9rem, 8vw, 2.35rem);
    line-height: 1.12;
    text-wrap: balance;
  }

  .portal-subtitle {
    font-size: 1rem;
    line-height: 1.5;
  }

  .portal-panel {
    width: 100%;
    padding: 24px 16px 20px;
    border-radius: 26px;
  }

  .portal-row {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 8px;
  }

  .portal-row span {
    font-size: 1.08rem;
    font-weight: 500;
  }

  .portal-row input {
    height: 48px;
    padding: 10px 12px;
  }

  .portal-actions {
    justify-content: stretch;
    padding-top: 0;
  }

  .portal-submit {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    font-size: 1.05rem;
  }

  .portal-form {
    gap: 16px;
  }

  .portal-feedback {
    min-height: 1.4rem;
  }

  .page-shell { width: min(100% - 20px, 1160px); padding-top: 18px; }
  .portal-card, .info-card, .login-card, .admin-card, .table-card { padding: 20px; border-radius: 22px; }
  .brand-lockup { align-items: flex-start; padding: 16px 18px; }
  .brand-logo { width: min(240px, 100%); }
  .card-header { padding-left: 0; }
  .portal-card::before { width: 100%; height: 8px; inset: 0 0 auto 0; }
  input, .primary-button, .secondary-button, .admin-link, .inline-button { width: 100%; }
  .button-row, .dashboard-actions, .table-actions { align-items: stretch; }
  .project-table { min-width: 620px; }
}

@media (max-width: 380px) {
  body.portal-home {
    padding-inline: 12px;
  }

  .portal-intro h1 {
    font-size: 1.72rem;
  }

  .portal-panel {
    padding: 20px 14px 18px;
    border-radius: 22px;
  }

  .portal-row span {
    font-size: 1rem;
  }

  .portal-row input,
  .portal-submit {
    min-height: 46px;
  }
}
