body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f7f9fc;
}

header {
  background: #0b2850;
  color: white;
  padding: 1rem 2rem;
}

.logo {
  font-size: 1.4rem;
  font-weight: bold;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.login-page {
  min-height: calc(100vh - 70px);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: white;
  padding: 2rem;
  border-radius: 14px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.login-card h1 {
  margin-top: 0;
  color: #0b2850;
}

.login-card label {
  display: block;
  margin-top: 1rem;
  font-weight: bold;
}

.login-card input,
.login-card select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.8rem;
  margin-top: 0.4rem;
  border: 1px solid #cfd7e3;
  border-radius: 8px;
}

.login-card input:focus,
.login-card select:focus {
  outline: none;
  border-color: #0b2850;
  box-shadow: 0 0 0 3px rgba(11, 40, 80, 0.12);
}

.form-message {
  display: none;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.form-message.success,
.form-message.error,
.form-message.info {
  display: block;
}

.form-message.success {
  background: #e7f7ec;
  color: #1f7a3f;
  border: 1px solid #b7e4c7;
}

.form-message.error {
  background: #fdeaea;
  color: #b3261e;
  border: 1px solid #f5c2c0;
}

.form-message.info {
  background: #eaf3ff;
  color: #0b5394;
  border: 1px solid #b6d7ff;
}

.login-card button {
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.9rem;
  border: none;
  border-radius: 8px;
  background: #0b2850;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

.login-card button:hover {
  background: #123b73;
}

.login-card button:disabled {
  background: #9aa8ba;
  cursor: not-allowed;
}

.login-card p {
  margin-top: 1.2rem;
  text-align: center;
}

.login-card a {
  color: #0b2850;
  font-weight: bold;
  text-decoration: none;
}

.login-card a:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  header {
    padding: 1rem;
  }

  .login-card {
    padding: 1.5rem;
  }
}

.hidden {
  display: none;
}

.secondary-btn {
  width: 100%;
  margin-top: 0.8rem;
  padding: 0.85rem;
  border: 1px solid #0b2850;
  border-radius: 8px;
  background: white;
  color: #0b2850;
  font-weight: bold;
  cursor: pointer;
}

.secondary-btn:hover {
  background: #f0f4fa;
}


/* =========================
   Hochschulzugang: E-Mail oder Matrikelnummer
========================= */
.identity-method {
  margin-top: 1rem;
}

.identity-method-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 700;
  color: #26364a;
}

.identity-method-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.identity-method-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 0;
  margin: 0;
  padding: 0.7rem 0.75rem;
  border: 1px solid #cfd7e3;
  border-radius: 9px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.identity-method-option:has(input:checked) {
  border-color: #0b2850;
  background: #eef4fb;
  color: #0b2850;
  box-shadow: 0 0 0 2px rgba(11, 40, 80, 0.08);
}

.identity-method-option:has(input:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}

.identity-method-option input[type="radio"] {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin: 0;
  padding: 0;
  accent-color: #0b2850;
}

@media (max-width: 380px) {
  .identity-method-options {
    grid-template-columns: 1fr;
  }
}

/* =========================
   Hochschul-E-Mail Composer
========================= */
.field-hint {
  display: block;
  margin-top: 0.45rem;
  color: #6b7280;
  font-size: 0.82rem;
  line-height: 1.4;
}

.login-card select {
  background: #fff;
  color: #222;
}

.email-composer {
  display: flex;
  align-items: stretch;
  width: 100%;
  margin-top: 0.4rem;
  border: 1px solid #cfd7e3;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-sizing: border-box;
}

.email-composer:focus-within {
  border-color: #0b2850;
  box-shadow: 0 0 0 3px rgba(11, 40, 80, 0.12);
}

.login-card .email-composer input {
  min-width: 0;
  flex: 1 1 auto;
  width: auto;
  margin-top: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.login-card .email-composer input:focus {
  border: 0;
  box-shadow: none;
}

.login-card .email-composer input:disabled {
  background: #f3f5f8;
  color: #7b8797;
}

.email-suffix {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 0.8rem;
  border-left: 1px solid #d9e0e8;
  background: #eef3f9;
  color: #0b2850;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.email-suffix.hidden {
  display: none;
}

.forgot-password-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.65rem;
}

.login-card .text-link-btn {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #0b2850;
  font: inherit;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
}

.login-card .text-link-btn:hover {
  background: transparent;
  text-decoration: underline;
}

.login-card .text-link-btn:disabled {
  background: transparent;
  color: #6f7d8f;
  cursor: wait;
  text-decoration: none;
}

@media (max-width: 420px) {
  .email-suffix {
    padding: 0 0.55rem;
    font-size: 0.78rem;
  }
}

/* Mobile form fields stay at 16px or more so iOS browsers do not
   auto-zoom them. Pinch-to-zoom remains available to the user. */
@media (max-width: 768px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="hidden"]),
  textarea:not([data-allow-small-text]),
  select:not([data-allow-small-text]) {
    font-size: 16px;
  }
}


/* Mobile width containment: prevents horizontal page expansion when a field
   receives focus on iOS/Brave. */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.login-page {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.login-card {
  min-width: 0;
  box-sizing: border-box;
}

.login-card input,
.login-card select,
.email-composer {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}


.auth-legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(213, 220, 229, 0.9);
  font-size: 0.82rem;
}

.auth-legal-links a {
  color: #315b89;
  font-weight: 700;
  text-decoration: none;
}

.auth-legal-links a:hover {
  text-decoration: underline;
}

/* Password visibility toggle */
.password-field {
  position: relative;
  width: 100%;
}

.password-field input {
  padding-right: 2.8rem;
}

.login-card .password-toggle {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: #66778a;
  cursor: pointer;
  line-height: 1;
  z-index: 2;
}

.password-eye-icon {
  position: relative;
  display: inline-flex;
  width: 1.1rem;
  height: 1.1rem;
}

.password-eye-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-eye-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.25rem;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg) scaleX(0);
  transition: transform 0.15s ease;
}

.login-card .password-toggle:hover {
  color: #0b2850;
}

.login-card .password-toggle:focus-visible {
  outline: 2px solid #0b2850;
  outline-offset: 2px;
  border-radius: 6px;
}

.login-card .password-toggle[aria-pressed="true"] {
  color: #0b2850;
}

.login-card .password-toggle[aria-pressed="true"] .password-eye-icon::after {
  transform: translate(-50%, -50%) rotate(45deg) scaleX(1);
}
