:root {
  --bg: #f4efe7;
  --surface: rgba(255, 251, 245, 0.9);
  --surface-strong: #fffdfa;
  --border: rgba(101, 78, 41, 0.15);
  --text: #211913;
  --muted: #665a4d;
  --gold: #a46a16;
  --gold-soft: rgba(164, 106, 22, 0.14);
  --danger: #a3483f;
  --danger-soft: rgba(163, 72, 63, 0.12);
  --success: #2e6c4d;
  --success-soft: rgba(46, 108, 77, 0.14);
  --shadow: 0 26px 70px rgba(52, 36, 12, 0.09);
  --accent: #2d59ea;
  --accent-soft: rgba(45, 89, 234, 0.09);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

/* Die Anmeldung steht fuer sich: dunkler Grund, eine Karte in der Mitte,
   darin nur das Noetige. Das Erklaerende drumherum ist weg -- wer hier
   landet, will sich anmelden, nicht lesen. */
body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #fff2df;
  background: #100e0b;
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.login-shell {
  align-items: center;
  display: grid;
  justify-items: center;
  min-height: 100vh;
  padding: 32px 20px;
}

.auth-stage {
  display: grid;
  gap: 16px;
  justify-items: center;
  width: 100%;
}

.auth-card,
.settings-card {
  background: #17130d;
  border: 1px solid rgba(190, 137, 53, 0.26);
  border-radius: 28px;
  max-width: 420px;
  padding: 34px 32px 30px;
  width: 100%;
}

.brand-logo {
  width: min(320px, 68%);
  height: auto;
  display: block;
  margin-bottom: 24px;
  filter: drop-shadow(0 20px 28px rgba(86, 62, 20, 0.08));
}

.eyebrow,
.session-label,
.helper-title {
  font-family: "Helvetica Neue", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 11px;
}

.eyebrow,
.helper-title {
  color: #c99036;
}

.app-mark-text {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-size: 1.15rem;
  line-height: 1.1;
}

.app-mark-text small {
  color: #c99036;
  display: block;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.22em;
}

/* Der Knopf ist die einzige farbige Flaeche der Seite -- deshalb der Verlauf
   aus Gold und Gruen, wie im Dashboard. */
.primary-btn {
  background: linear-gradient(135deg, #c99036, #74d7a4) !important;
  border: 0 !important;
  color: #100e0b !important;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin-top: 6px;
  padding: 17px !important;
  width: 100%;
}

/* Helle Felder auf dunklem Grund: der Kontrast sagt, wo man tippt -- ganz
   ohne Beschriftung daneben. */
.field {
  background: #ece7dd !important;
  border: 1px solid transparent !important;
  border-radius: 14px !important;
  color: #1a1610 !important;
}

.field::placeholder {
  color: #6f6a61;
}

.field:focus {
  border-color: #c99036 !important;
  outline: none;
}

.field-large {
  font-size: 1rem !important;
  min-height: 0 !important;
  padding: 17px 18px !important;
}

.quiet-link {
  display: block;
  margin: 18px auto 0;
}

/* Ueberschrift in der Serifenschrift wie ueberall bei uns -- sie ist das
   einzige, was hier wie DUDA aussieht. */
.auth-card h2 {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-size: 2.1rem;
  letter-spacing: -0.01em;
}

.auth-subtitle {
  color: #cbb99e !important;
  font-size: 0.92rem !important;
  margin: 8px 0 0 !important;
}

/* Das Logo bringt seine eigene Farbe mit -- ohne Kasten und ohne Filter.
   Und es steht neben der Wortmarke, nicht darueber: die Grundfassung macht
   aus .app-mark ein 72 Punkt grosses Quadrat mit place-items:center, in dem
   Zeichen und Schriftzug uebereinander lagen und seitlich herausstanden. */
.app-mark {
  align-items: center !important;
  background: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: flex !important;
  gap: 12px !important;
  height: auto !important;
  padding: 0 !important;
  width: auto !important;
}

.app-mark-logo {
  filter: none !important;
  height: 38px !important;
  width: 38px !important;
}

.role-toggle {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(190, 137, 53, 0.26) !important;
  border-radius: 999px !important;
}

.role-pill {
  color: #cbb99e !important;
  font-size: 0.86rem !important;
  padding: 8px 16px !important;
}

.role-pill.active {
  background: rgba(201, 144, 54, 0.18) !important;
  box-shadow: none !important;
  color: #fff2df !important;
}

/* Der Block "Bereits verbunden" steht an derselben Stelle wie sonst das
   Anmeldeformular -- und braucht denselben Abstand zur Meldung darueber.
   Ohne ihn klebten die beiden Kaesten aneinander. */
.session-ready {
  margin-top: 18px;
}

/* Links tragen keine eigene Farbe: unterstrichen reicht, und die Seite
   bleibt bei zwei Farben. */
.link-btn {
  color: #fff2df !important;
  font-size: 0.88rem !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.inline-helper-row {
  justify-content: center !important;
  margin-top: 8px;
}

.state-banner,
.feedback,
.settings-note,
.session-ready {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(190, 137, 53, 0.26) !important;
  border-radius: 16px !important;
  color: #cbb99e;
  font-size: 0.86rem;
  padding: 12px 14px !important;
}

.divider-row {
  color: #8d8171;
  font-size: 0.8rem;
  margin: 26px 0 18px;
}

.divider-row span {
  background: rgba(190, 137, 53, 0.26);
}

.oauth-btn {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(190, 137, 53, 0.26) !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  color: #fff2df !important;
  font-size: 0.95rem !important;
  min-height: 0 !important;
  padding: 15px !important;
}

.oauth-btn:hover {
  border-color: #c99036;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(190, 137, 53, 0.26) !important;
  color: #fff2df !important;
}

.session-email {
  color: #fff2df;
}

.settings-card h2 {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
}

.field-icon-btn {
  color: #6f6a61 !important;
}

.brand-card h1,
.auth-card h2,
.settings-card h2 {
  margin: 0;
}

.brand-card h1 {
  max-width: 11ch;
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.brand-copy,
.state-banner,
.feedback,
.helper-list,
.settings-note p,
.session-email {
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: var(--muted);
  line-height: 1.6;
}

.brand-copy {
  max-width: 56ch;
  margin: 18px 0 0;
}

.benefit-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.benefit-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  color: var(--text);
}

.auth-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  margin-bottom: 18px;
}

.auth-head-tight {
  margin-bottom: 18px;
}

.auth-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.app-mark {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: linear-gradient(180deg, #3c67f0 0%, var(--accent) 100%);
  display: grid;
  place-items: center;
  box-shadow: 0 18px 32px rgba(45, 89, 234, 0.2);
}

.app-mark-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.role-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid rgba(27, 38, 78, 0.16);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.84);
}

.role-pill {
  border: 0;
  background: transparent;
  color: #2a2c33;
  padding: 14px 26px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  cursor: pointer;
}

.role-pill.active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.ghost-btn,
.primary-btn {
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 140ms ease;
}

.ghost-btn:hover,
.primary-btn:hover {
  transform: translateY(-1px);
}

.ghost-btn:disabled,
.primary-btn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.primary-btn {
  border: 1px solid var(--text);
  background: var(--text);
  color: #fff8ef;
}

.ghost-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

.compact-btn {
  padding: 10px 14px;
}

.state-banner,
.feedback,
.helper-box,
.settings-note,
.session-ready {
  border-radius: 22px;
  border: 1px solid var(--border);
  padding: 16px;
  background: rgba(255, 255, 255, 0.7);
}

.state-banner.info {
  background: rgba(255, 252, 246, 0.84);
}

.state-banner.success,
.feedback.success {
  background: rgba(239, 251, 244, 0.94);
  color: var(--success);
}

.state-banner.error,
.feedback.error {
  background: rgba(253, 236, 232, 0.94);
  color: var(--danger);
}

.state-banner.warning,
.feedback.warning {
  background: rgba(255, 246, 230, 0.96);
  color: #7a5318;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.field-block {
  display: grid;
  gap: 8px;
}

.field {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
  padding: 14px 16px;
}

.field-large {
  min-height: 64px;
  border-radius: 20px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 20px;
  padding: 18px 20px;
}

.password-wrap {
  position: relative;
}

.password-field {
  padding-right: 110px;
}

.field-icon-btn {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #8c8379;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  cursor: pointer;
}

.auth-subtitle {
  margin: 10px 0 0;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 1.05rem;
  color: #57657f;
}

.inline-helper-row {
  display: flex;
  justify-content: flex-end;
}

.link-btn {
  border: 0;
  background: transparent;
  padding: 0;
  color: #2f79dd;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.98rem;
  cursor: pointer;
}

.divider-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin: 22px 0 18px;
  color: #a8b1c0;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.divider-row span {
  height: 1px;
  background: rgba(108, 116, 130, 0.2);
}

.oauth-btn {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(54, 71, 103, 0.14);
  background: #ffffff;
  color: #263146;
  min-height: 62px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(37, 45, 63, 0.05);
}

.session-ready {
  margin-bottom: 16px;
}

.session-label {
  margin: 0 0 8px;
  color: var(--gold);
}

.session-email {
  margin: 0;
}

.session-actions,
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.feedback {
  margin-top: 16px;
}

.helper-box {
  margin-top: 18px;
}

.helper-title {
  margin: 0 0 10px;
}

.helper-list {
  margin: 0;
  padding-left: 18px;
}

.settings-note {
  margin-top: 18px;
}

@media (max-width: 1080px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .brand-stage {
    padding-bottom: 0;
  }
}

@media (max-width: 720px) {
  .brand-stage,
  .auth-stage {
    padding: 18px;
  }

  .brand-card,
  .auth-card,
  .settings-card {
    padding: 22px;
  }

  .auth-head,
  .session-actions,
  .settings-actions {
    display: grid;
  }

  .auth-topline {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .role-toggle {
    width: 100%;
  }

  .brand-card h1 {
    max-width: none;
  }
}
