:root {
  --dekra-green: #00854a;
  --dekra-green-dark: #006b3b;
  --dekra-green-soft: #e8f5ee;
  --ink: #16211c;
  --muted: #5b6861;
  --line: #dce5e0;
  --surface: #ffffff;
  --canvas: #f4f7f5;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --shadow: 0 18px 48px rgba(16, 48, 31, 0.09);
  --radius: 18px;
  font-family: "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 100% 0, rgba(0, 133, 74, 0.09), transparent 32rem), var(--canvas);
}
button, input { font: inherit; }
a { color: inherit; }

.site-header {
  min-height: 76px;
  padding: 0 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 18px rgba(10, 56, 32, 0.04);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--dekra-green); text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 5px solid var(--dekra-green); border-left-color: transparent;
  transform: rotate(30deg) skew(-12deg);
}
.brand-mark span { width: 8px; height: 8px; display: block; background: var(--dekra-green); border-radius: 50%; }
.brand-name { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.04em; }
.brand-divider { width: 1px; height: 28px; margin: 0 4px; background: var(--line); }
.brand-product { color: var(--ink); font-size: 0.98rem; font-weight: 650; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.environment-badge {
  padding: 7px 10px; border: 1px solid #e1a900; border-radius: 999px;
  color: #6e5200; background: #fff8d9; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em;
}
.sign-out { color: var(--muted); font-size: 0.9rem; font-weight: 650; text-decoration: none; }
.sign-out:hover { color: var(--dekra-green); text-decoration: underline; }
.link-button { padding: 4px; color: var(--muted); background: transparent; border: 0; cursor: pointer; font-size: 0.9rem; font-weight: 650; }
.link-button:hover { color: var(--dekra-green); text-decoration: underline; }
.link-button:focus-visible { outline: 3px solid rgba(0, 133, 74, 0.24); outline-offset: 3px; }
.page-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 62px 0 54px; }

.center-card { min-height: 210px; padding: 42px; display: flex; align-items: center; justify-content: center; gap: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.center-card[hidden], #dashboard-view[hidden], .signed-out[hidden] { display: none !important; }
.signed-out { min-height: 580px; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.55fr); align-items: center; gap: clamp(48px, 8vw, 120px); }
.signed-out h1 { max-width: 760px; }
.signed-out .hero-copy > p:not(.privacy-note) { max-width: 680px; color: var(--muted); font-size: 1.06rem; line-height: 1.65; }
.button-large { min-height: 50px; margin-top: 14px; padding-inline: 24px; }
.privacy-note { margin-top: 14px; color: var(--muted); font-size: 0.8rem; }
.sign-in-visual { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--dekra-green-dark); background: radial-gradient(circle, #fff 0 42%, transparent 43%), var(--dekra-green-soft); border: 1px solid #b9dfcb; border-radius: 50%; box-shadow: var(--shadow); }
.sign-in-visual strong { margin-top: 14px; font-size: 1.3rem; }
.sign-in-visual small { margin-top: 4px; color: var(--muted); }
.visual-shield { width: 66px; height: 76px; display: grid; place-items: center; color: white; background: var(--dekra-green); clip-path: polygon(50% 0, 94% 16%, 88% 72%, 50% 100%, 12% 72%, 6% 16%); font-size: 1.7rem; font-weight: 900; }

.hero { display: flex; justify-content: space-between; align-items: end; gap: 48px; margin-bottom: 28px; }
.hero-copy { max-width: 710px; }
.eyebrow { color: var(--dekra-green); font-size: 0.77rem; font-weight: 800; letter-spacing: 0.13em; }
h1 { margin: 10px 0 12px; font-size: clamp(2.35rem, 5vw, 4.2rem); line-height: 0.98; letter-spacing: -0.055em; }
.hero p { max-width: 700px; margin: 0; color: var(--muted); font-size: 1.06rem; line-height: 1.65; }
.account-chip {
  min-width: 245px; padding: 12px 16px; display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 8px 24px rgba(10, 56, 32, 0.05);
}
.account-icon {
  width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center;
  border-radius: 50%; color: white; background: var(--dekra-green); font-size: 0.76rem; font-weight: 800;
}
.account-chip small, .account-chip strong { display: block; }
.account-chip small { color: var(--muted); font-size: 0.72rem; }
.account-chip strong { max-width: 230px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; }
.account-email { display: block; max-width: 230px; margin-top: 1px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 0.7rem; }

.security-callout {
  margin-bottom: 22px; padding: 18px 22px; display: flex; align-items: center; gap: 15px;
  border: 1px solid #b9dfcb; border-radius: 14px; background: var(--dekra-green-soft);
}
.shield-icon {
  width: 34px; height: 38px; flex: 0 0 34px; display: grid; place-items: center;
  color: #fff; background: var(--dekra-green);
  clip-path: polygon(50% 0, 94% 16%, 88% 72%, 50% 100%, 12% 72%, 6% 16%); font-weight: 800;
}
.security-callout strong { color: var(--dekra-green-dark); }
.security-callout p { margin: 3px 0 0; color: #315c45; font-size: 0.88rem; line-height: 1.45; }

.content-card { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-heading { padding: 26px 28px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.card-heading h2, .help-row h2 { margin: 0; font-size: 1.2rem; letter-spacing: -0.02em; }
.card-heading p { margin: 5px 0 0; color: var(--muted); font-size: 0.9rem; }

.button {
  min-height: 42px; padding: 9px 17px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-weight: 750;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:focus-visible, input:focus-visible, .sign-out:focus-visible { outline: 3px solid rgba(0, 133, 74, 0.24); outline-offset: 2px; }
.button:disabled { cursor: wait; opacity: 0.62; }
.button-primary { color: white; background: var(--dekra-green); border-color: var(--dekra-green); }
.button-primary:hover:not(:disabled) { background: var(--dekra-green-dark); }
.button-secondary { color: var(--ink); background: #fff; border-color: #b9c7c0; }
.button-danger { min-height: 36px; color: var(--danger); background: #fff; border-color: #e7b8b2; font-size: 0.83rem; }
.button-danger:hover:not(:disabled) { background: var(--danger-soft); }
.button-danger-solid { color: white; background: var(--danger); border-color: var(--danger); }
.button-danger-solid:hover:not(:disabled) { background: #8f2017; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.state-panel { min-height: 180px; padding: 34px 28px; display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--muted); text-align: center; }
.state-panel[hidden], .passkey-list[hidden] { display: none !important; }
.spinner { width: 22px; height: 22px; border: 3px solid #cfe4d9; border-top-color: var(--dekra-green); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.state-error { margin: 24px; min-height: 130px; justify-content: flex-start; text-align: left; color: #7a271f; background: var(--danger-soft); border: 1px solid #f0c3bd; border-radius: 12px; }
.state-error p { margin: 5px 0 15px; overflow-wrap: anywhere; }
.state-symbol { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; color: #fff; background: var(--danger); border-radius: 50%; font-weight: 900; }
.empty-state { flex-direction: column; }
.empty-state strong { display: block; color: var(--ink); font-size: 1rem; }
.empty-state p { margin: 6px 0 0; }
.key-illustration { color: var(--dekra-green); font-size: 2.6rem; font-weight: 800; letter-spacing: -0.22em; }

.passkey-list { display: grid; }
.passkey-item { padding: 22px 28px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); }
.passkey-item:last-child { border-bottom: 0; }
.passkey-icon { width: 48px; height: 48px; display: grid; place-items: center; color: var(--dekra-green); background: var(--dekra-green-soft); border-radius: 13px; font-size: 1.35rem; font-weight: 900; }
.passkey-details strong { display: block; font-size: 0.98rem; }
.passkey-meta { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 0.78rem; }
.passkey-meta span { display: inline-flex; align-items: center; gap: 5px; }

.help-row { margin-top: 24px; padding: 22px 25px; display: flex; justify-content: space-between; gap: 40px; color: var(--muted); border-left: 4px solid var(--dekra-green); }
.help-row h2 { color: var(--ink); }
.help-row p { max-width: 720px; margin: 7px 0 0; font-size: 0.88rem; line-height: 1.55; }
.browser-language { align-self: center; font-size: 0.76rem; text-align: right; }

.passkey-dialog { width: min(470px, calc(100% - 32px)); padding: 0; color: var(--ink); border: 0; border-radius: 18px; box-shadow: 0 28px 90px rgba(7, 36, 21, 0.28); }
.passkey-dialog::backdrop { background: rgba(7, 28, 17, 0.58); backdrop-filter: blur(3px); }
.passkey-dialog form { padding: 30px; }
.dialog-icon { width: 44px; height: 44px; display: grid; place-items: center; color: #fff; background: var(--dekra-green); border-radius: 12px; font-size: 1.5rem; }
.dialog-icon-danger { background: var(--danger); }
.passkey-dialog h2 { margin: 18px 0 7px; font-size: 1.35rem; }
.passkey-dialog p { margin: 0 0 22px; color: var(--muted); line-height: 1.5; }
.passkey-dialog label { display: block; margin-bottom: 7px; font-size: 0.84rem; font-weight: 750; }
.passkey-dialog input { width: 100%; height: 46px; padding: 0 12px; border: 1px solid #aebeb6; border-radius: 8px; }
.passkey-dialog small { display: block; margin-top: 6px; color: var(--muted); }
.dialog-actions { margin-top: 25px; display: flex; justify-content: flex-end; gap: 10px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: min(430px, calc(100% - 48px)); padding: 15px 18px; color: #fff; background: #183b29; border-radius: 10px; box-shadow: 0 16px 44px rgba(0,0,0,0.2); font-size: 0.88rem; }
.toast.error { background: #8f2017; }
.toast[hidden] { display: none; }
.busy-overlay { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(7, 28, 17, 0.58); backdrop-filter: blur(3px); }
.busy-overlay[hidden] { display: none; }
.busy-card { min-width: min(390px, calc(100vw - 40px)); padding: 28px; display: flex; align-items: center; justify-content: center; gap: 14px; background: #fff; border-radius: 14px; box-shadow: 0 28px 90px rgba(7, 36, 21, 0.28); }
.site-footer { padding: 22px 5vw 28px; display: flex; justify-content: space-between; gap: 20px; color: #708078; border-top: 1px solid var(--line); font-size: 0.75rem; }

@media (max-width: 760px) {
  .site-header { padding: 15px 20px; align-items: flex-start; }
  .brand-product, .brand-divider { display: none; }
  .header-actions { align-items: flex-end; flex-direction: column; gap: 8px; }
  .environment-badge { font-size: 0.61rem; }
  .page-shell { width: min(100% - 28px, 1120px); padding-top: 38px; }
  .signed-out { min-height: auto; grid-template-columns: 1fr; }
  .sign-in-visual { width: min(300px, 80vw); justify-self: center; }
  .hero { align-items: stretch; flex-direction: column; gap: 22px; }
  .account-chip { width: 100%; }
  .card-heading { align-items: stretch; flex-direction: column; }
  .card-heading .button { width: 100%; }
  .passkey-item { grid-template-columns: auto 1fr; padding: 20px; }
  .passkey-item .button { grid-column: 1 / -1; width: 100%; }
  .help-row, .site-footer { flex-direction: column; }
  .browser-language { align-self: flex-start; text-align: left; }
}

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