/* Backend Styling mit Brand Colors – fluid & viewport-safe */

/* -------- Root & Base -------- */
:root{
  /* Fluid Spacing & Font-Scale */
  --space: clamp(12px, 3vw, 32px);
  --radius: clamp(12px, 2vw, 20px);
  --shadow: 0 25px 50px rgba(16, 60, 97, 0.4), 0 0 0 2px rgba(58, 176, 248, 0.2);
  font-size: clamp(15px, 0.6vw + 0.75rem, 18px);
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
}

body {
  background: linear-gradient(135deg, #103C61 0%, #295E8A 50%, #508CAE 100%);
  background-image: url(../weltraum.png);
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  background-blend-mode: overlay;
  margin: 0;
  padding: calc(var(--space) + env(safe-area-inset-top))
           var(--space)
           calc(var(--space) + env(safe-area-inset-bottom));
  color: #FFFFFE;
  text-align: center;
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;

  /* Zentrierung ohne absolute Positionierung */
  display: grid;
  place-items: center;
  min-height: 100svh;
}

@supports (height: 100dvh){
  body{ min-height: 100dvh; }
}

/* -------- Login Box -------- */
.login-box {
  /* Weg von absolute/transform – flexible Box */
  position: static;
  width: min(92vw, 680px);
  max-width: 680px;
  min-width: 280px;
  padding: clamp(20px, 3vw, 40px);
  margin: 0 auto;

  background: rgba(16, 60, 97, 0.95);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  border: 2px solid rgba(58, 176, 248, 0.3);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* Höhenanpassung + innere Scrollbarkeit bei engen Viewports */
  max-height: calc(100svh - var(--space) * 2);
  overflow: auto;
}

@supports (height: 100dvh){
  .login-box { max-height: calc(100dvh - var(--space) * 2); }
}

/* Dezentes Hover nur mit Maus */
@media (pointer:fine){
  .login-box:hover {
    /* kein Scale-Jump, Box bleibt ruhig */
    box-shadow:
      0 35px 70px rgba(16, 60, 97, 0.5),
      0 0 0 3px rgba(58, 176, 248, 0.4);
  }
}

.login-box h2 {
  margin: 0 0 30px;
  padding: 0;
  color: #FFFFFE;
  text-align: center;
  font-size: clamp(1.3rem, 1.2rem + 0.8vw, 2rem);
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(16, 60, 97, 0.5);
  letter-spacing: -0.5px;
}

.login-box p {
  color: rgba(255, 255, 254, 0.9);
  margin-bottom: 30px;
  font-size: clamp(0.95rem, 1vw, 1.1rem);
  line-height: 1.7;
}

.login-box form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-box .user-box, .card .user-box { position: relative; }

.login-box .user-box input, .card .user-box input {
  width: 100%;
  padding: clamp(10px, 1.8vw, 15px) clamp(12px, 2.5vw, 20px);
  font-size: 16px;
  color: #FFFFFE;
  margin-bottom: 20px;
  border: 2px solid rgba(58, 176, 248, 0.3);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 254, 0.1);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.login-box .user-box input:focus, .card .user-box input:focus {
  border-color: #3AB0F8;
  background: rgba(255, 255, 254, 0.15);
  box-shadow: 0 0 25px rgba(58, 176, 248, 0.4);
  transform: translateY(-2px);
}

/* Grundstil für alle Formfelder in deinen Karten */
.cards .user-box input,
.cards .user-box select,
.cards .user-box textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #4f7ba3;
  background: #0e2f4b;
  color: #fff;
  outline: none;
}

/* Fokus sichtbar & barrierearm */
.cards .user-box input:focus,
.cards .user-box select:focus,
.cards .user-box textarea:focus {
  border-color: #7fc0ff;
  box-shadow: 0 0 0 3px rgba(127,192,255,.25);
}

/* Number-Spinner ausblenden (Chrome/Edge) */
.cards .user-box input[type="number"]::-webkit-outer-spin-button,
.cards .user-box input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
/* Number-Spinner ausblenden (Firefox) */
.cards .user-box input[type="number"] {
  -moz-appearance: textfield;
}

/* Date-Picker lesbar */
.cards .user-box input[type="date"] {
  color-scheme: dark; /* dunkle Picker in dunklem UI */
}


/* -------- Termin Cards -------- */
.termin-selection { margin-bottom: 20px; }

/* Karten nebeneinander & responsiv */
.termin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

/* Label als Blockkarte */
.termin-card {
  display: block;
  background: rgba(255, 255, 254, 0.1);
  border: 2px solid rgba(58, 176, 248, 0.2);
  border-radius: 15px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

/* Hover-Effekt */
.termin-card:hover {
  background: rgba(255, 255, 254, 0.15);
  border-color: rgba(58, 176, 248, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(58, 176, 248, 0.2);
}

/* Radio unsichtbar, aber klickbar über die ganze Karte */
.termin-card input[type="radio"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: auto;   /* wichtig: klickbar */
  cursor: pointer;
}

/* Ausgewählt – via :has() (kein JS nötig) */
.termin-card:has(input[type="radio"]:checked),
.termin-card.selected {   /* Fallback, falls JS nutzt */
  background: rgba(58, 176, 248, 0.2);
  border-color: #3AB0F8;
  box-shadow: 0 0 25px rgba(58, 176, 248, 0.4);
}

/* Inhalt */
.termin-card .termin-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.termin-card .termin-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #3AB0F8, #295E8A);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFE;
  font-size: 20px;
  box-shadow: 0 5px 15px rgba(58, 176, 248, 0.3);
}

.termin-card .termin-info h4 {
  margin: 0 0 5px 0;
  color: #FFFFFE;
  font-size: 1.1rem;
  font-weight: 600;
}

.termin-card .termin-info p {
  margin: 0;
  color: rgba(255, 255, 254, 0.8);
  font-size: 0.9rem;
}

.termin-card .termin-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid rgba(58, 176, 248, 0.2);
}

.termin-card .termin-date {
  font-size: 1.2rem;
  font-weight: 700;
  color: #3AB0F8;
}

.termin-card .termin-time {
  background: rgba(58, 176, 248, 0.2);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  color: #FFFFFE;
  font-weight: 500;
}

.termin-card .checkmark {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 25px;
  height: 25px;
  background: #3AB0F8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFE;
  font-size: 14px;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
}

/* Checkmark zeigen, wenn ausgewählt */
.termin-card:has(input[type="radio"]:checked) .checkmark,
.termin-card.selected .checkmark {
  opacity: 1;
  transform: scale(1);
}

/* Optional: Spaltenanzahl je Breakpoint feinsteuern */
@media (min-width: 480px) {
  .termin-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}
@media (min-width: 900px) {
  .termin-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}

/* -------- Select (Fallback) -------- */
.login-box .user-box select {
  width: 100%;
  padding: clamp(10px, 1.8vw, 15px) clamp(12px, 2.5vw, 20px);
  font-size: 16px;
  color: #FFFFFE;
  margin-bottom: 20px;
  border: 2px solid rgba(58, 176, 248, 0.3);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 254, 0.1);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%233AB0F8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 20px;
  padding-right: 50px;
}

.login-box .user-box select:hover {
  border-color: #3AB0F8;
  background-color: rgba(255, 255, 254, 0.15);
  transform: translateY(-2px);
}

.login-box .user-box select:focus {
  border-color: #3AB0F8;
  background-color: rgba(255, 255, 254, 0.2);
  box-shadow: 0 0 25px rgba(58, 176, 248, 0.4);
  transform: translateY(-2px);
}

.login-box .user-box select option {
  background: rgba(16, 60, 97, 0.95);
  color: #FFFFFE;
  padding: 15px;
  border: none;
  border-radius: 8px;
  margin: 2px 0;
  transition: all 0.3s ease;
}

.login-box .user-box select option:hover {
  background: rgba(58, 176, 248, 0.3);
}

.login-box .user-box select option:checked {
  background: rgba(58, 176, 248, 0.5);
  color: #FFFFFE;
  font-weight: 600;
}

/* -------- Labels -------- */
.login-box .user-box label, .card .user-box label {
  position: absolute;
  top: 0;
  left: 20px;
  padding: 0 8px;
  font-size: 14px;
  color: rgba(58, 176, 248, 0.8);
  background: rgba(16, 60, 97, 0.95);
  border-radius: 6px;
  transform: translateY(-50%);
  transition: all 0.3s ease;
  pointer-events: none;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.login-box .user-box input:focus + label,
.login-box .user-box select:focus + label,
.login-box .user-box input:not(:placeholder-shown) + label,
.login-box .user-box select:not([value=""]) + label,
.card .user-box input:focus + label,
.card .user-box select:focus + label,
.card .user-box input:not(:placeholder-shown) + label,
.card .user-box select:not([value=""]) + label {
  color: #3AB0F8;
  transform: translateY(-50%) scale(1.05);
  background: rgba(16, 60, 97, 0.98);
  box-shadow: 0 2px 8px rgba(58, 176, 248, 0.3);
}

/* -------- Buttons -------- */
.submit {
  position: relative;
  display: inline-block;
  padding: clamp(10px, 1.8vw, 15px) clamp(16px, 3vw, 30px);
  color: #FFFFFE;
  font-size: 16px;
  text-decoration: none;
  text-transform: uppercase;
  overflow: hidden;
  transition: 0.5s;
  margin-top: 20px;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #3AB0F8 0%, #295E8A 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 8px 25px rgba(58, 176, 248, 0.3);
  backdrop-filter: blur(10px);
  width: 100%;
}

.submit:hover {
  background: linear-gradient(135deg, #295E8A 0%, #3AB0F8 100%);
  color: #FFFFFE;
  box-shadow: 0 12px 35px rgba(58, 176, 248, 0.5);
  transform: translateY(-3px);
}

.submit:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(58, 176, 248, 0.4);
}

.submit span { position: absolute; display: block; }

.submit span:nth-child(1) {
  top: 0; left: -100%; width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, #3AB0F8);
  animation: btn-anim1 1s linear infinite;
}
@keyframes btn-anim1 { 0% { left: -100%; } 50%,100% { left: 100%; } }

.submit span:nth-child(2) {
  top: -100%; right: 0; width: 2px; height: 100%;
  background: linear-gradient(180deg, transparent, #3AB0F8);
  animation: btn-anim2 1s linear infinite; animation-delay: .25s
}
@keyframes btn-anim2 { 0% { top: -100%; } 50%,100% { top: 100%; } }

.submit span:nth-child(3) {
  bottom: 0; right: -100%; width: 100%; height: 2px;
  background: linear-gradient(270deg, transparent, #3AB0F8);
  animation: btn-anim3 1s linear infinite; animation-delay: .5s
}
@keyframes btn-anim3 { 0% { right: -100%; } 50%,100% { right: 100%; } }

.submit span:nth-child(4) {
  bottom: -100%; left: 0; width: 2px; height: 100%;
  background: linear-gradient(360deg, transparent, #3AB0F8);
  animation: btn-anim4 1s linear infinite; animation-delay: .75s
}
@keyframes btn-anim4 { 0% { bottom: -100%; } 50%,100% { bottom: 100%; } }

/* Button Group */
.btn-group {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  color: #FFFFFE;
  font-size: 16px;
  text-decoration: none;
  text-transform: uppercase;
  border-radius: 12px;
  transition: all 0.3s ease;
  font-weight: 600;
  letter-spacing: 1px;
  border: 2px solid transparent;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.btn-primary {
  background: linear-gradient(135deg, #3AB0F8 0%, #295E8A 100%);
  box-shadow: 0 8px 25px rgba(58, 176, 248, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #295E8A 0%, #3AB0F8 100%);
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(58, 176, 248, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 254, 0.1);
  border-color: rgba(58, 176, 248, 0.3);
  color: #FFFFFE;
}
.btn-secondary:hover {
  background: rgba(58, 176, 248, 0.2);
  border-color: #3AB0F8;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(58, 176, 248, 0.3);
}

/* -------- Datenschutzbox -------- */
.datenschutzbedingungen {
  margin-top: 25px;
  padding: 20px;
  background: rgba(58, 176, 248, 0.1);
  border: 1px solid rgba(58, 176, 248, 0.2);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}
.datenschutzbedingungen p {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 254, 0.8);
  line-height: 1.6;
}
.datenschutzbedingungen a {
  color: #3AB0F8;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}
.datenschutzbedingungen a:hover {
  color: #FFFFFE;
  text-shadow: 0 0 10px rgba(58, 176, 248, 0.8);
}

/* -------- Infos & Danger -------- */
.info, .danger {
  padding: 20px;
  margin: 20px 0;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 15px;
  font-weight: 500;
}
.info   { background: rgba(58, 176, 248, 0.1); border-color: rgba(58, 176, 248, 0.3); color: #FFFFFE; }
.danger { background: rgba(244, 67, 54, 0.1); border-color: rgba(244, 67, 54, 0.3); color: #FFFFFE; }
.info i, .danger i { font-size: 20px; flex-shrink: 0; }
.info i { color: #3AB0F8; }
.danger i { color: #F44336; }

/* -------- Footer -------- */
footer {
  position: static;             /* nicht fixed, damit nichts überdeckt wird */
  margin-top: var(--space);
  padding-bottom: env(safe-area-inset-bottom);
  text-align: center;
}
.footer-link {
  color: rgba(255, 255, 254, 0.7);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 14px;
}
.footer-link:hover {
  color: #3AB0F8;
  text-shadow: 0 0 10px rgba(58, 176, 248, 0.5);
}

/* -------- Responsive Tweaks -------- */
@media (max-width: 1400px) {
  .login-box { max-width: 650px; }
}
@media (max-width: 1200px) {
  .login-box { max-width: 600px; }
}
@media (max-width: 992px) {
  .login-box { max-width: 520px; }
  .termin-grid { grid-template-columns: 1fr; gap: 12px; }
  .termin-card { padding: 18px; }
}
@media (max-width: 768px) {
  .login-box {
    width: 95%;
    max-width: 460px;
    padding: 20px 15px;
  }
  .login-box h2 { font-size: 1.4rem; margin-bottom: 15px; }
  .login-box p  { font-size: 0.95rem; margin-bottom: 15px; }
  .login-box .user-box input,
  .login-box .user-box select { padding: 12px 15px; font-size: 16px; margin-bottom: 12px; }
  .login-box .user-box label { font-size: 12px; left: 15px; }

  .btn-group { flex-direction: column; gap: 10px; }
  .btn-primary, .btn-secondary {
    padding: 10px 18px; font-size: 14px; justify-content: center; width: 100%;
  }

  .termin-card { padding: 15px; }
  .termin-card .termin-header { gap: 12px; margin-bottom: 12px; }
  .termin-card .termin-icon { width: 40px; height: 40px; font-size: 16px; }
  .termin-card .termin-info h4 { font-size: 1rem; }
  .termin-card .termin-info p  { font-size: 0.8rem; }

  .timeline-item { flex-direction: column; text-align: center; gap: 15px; }
  .timeline-connector {
    width: 40px; height: 3px;
    background: linear-gradient(90deg, #3AB0F8, rgba(58, 176, 248, 0.3));
  }
  .status-badge { font-size: 12px; padding: 6px 12px; }

  .info, .danger { flex-direction: column; text-align: center; padding: 15px; }
  .info i, .danger i { font-size: 24px; }
}

@media (max-width: 600px) {
  .login-box { width: 98%; max-width: 420px; padding: 18px 12px; }
  .login-box h2{ font-size: 1.3rem; }
  .login-box p { font-size: 0.9rem; }
  .login-box .user-box input,
  .login-box .user-box select { padding: 10px 12px; font-size: 16px; }
  .btn-primary, .btn-secondary { padding: 8px 16px; font-size: 13px; }
  .termin-card { padding: 12px; }
  .termin-card .termin-header { gap: 10px; margin-bottom: 10px; }
  .termin-card .termin-icon { width: 35px; height: 35px; font-size: 14px; }
  .termin-card .termin-info h4 { font-size: 0.9rem; }
  .termin-card .termin-info p  { font-size: 0.75rem; }
  .termin-card .termin-details { padding-top: 12px; }
  .termin-card .termin-date { font-size: 1rem; }
  .termin-card .termin-time { padding: 4px 10px; font-size: 0.8rem; }
  .datenschutzbedingungen { padding: 15px; margin-top: 20px; }
  .datenschutzbedingungen p { font-size: 12px; }
}

@media (max-width: 480px) {
  .login-box { width: 100%; max-width: none; min-width: 280px; padding: 15px 10px; border-radius: 15px; margin: 10px; }
  .login-box h2{ font-size: 1.2rem; margin-bottom: 12px; }
  .login-box p { font-size: 0.85rem; margin-bottom: 12px; }
  .login-box .user-box input,
  .login-box .user-box select { padding: 8px 10px; font-size: 16px; margin-bottom: 10px; }

  .btn-primary, .btn-secondary { padding: 8px 14px; font-size: 12px; }
  .termin-card { padding: 10px; }
  .termin-card .termin-header { gap: 8px; margin-bottom: 8px; }
  .termin-card .termin-icon { width: 30px; height: 30px; font-size: 12px; }
  .termin-card .termin-info h4 { font-size: 0.85rem; }
  .termin-card .termin-info p  { font-size: 0.7rem; }
}

@media (max-width: 360px) {
  .login-box { padding: 12px 8px; border-radius: 12px; }
  .login-box h2{ font-size: 1.1rem; margin-bottom: 10px; }
  .login-box p { font-size: 0.8rem; margin-bottom: 10px; }
  .login-box .user-box input,
  .login-box .user-box select { padding: 6px 8px; font-size: 14px; margin-bottom: 8px; }
  .btn-primary, .btn-secondary { padding: 6px 12px; font-size: 11px; }
  .termin-card { padding: 8px; }
  .termin-card .termin-header { gap: 6px; margin-bottom: 6px; }
  .termin-card .termin-icon { width: 25px; height: 25px; font-size: 10px; }
  .termin-card .termin-info h4 { font-size: 0.8rem; }
  .termin-card .termin-info p  { font-size: 0.65rem; }
}

/* Landscape kompakt */
@media (max-height: 500px) and (orientation: landscape) {
  .login-box {
    padding: 15px 25px;
    max-height: 85vh;
    overflow-y: auto;
    margin: 10px auto;
  }
  .login-box h2 { margin-bottom: 10px; font-size: 1.2rem; }
  .login-box p  { margin-bottom: 10px; font-size: 0.9rem; }
  .login-box form { gap: 10px; }
  .login-box .user-box input,
  .login-box .user-box select { margin-bottom: 8px; padding: 8px 12px; }
  .termin-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
  .termin-card { padding: 10px; }
  .termin-card .termin-header { gap: 8px; margin-bottom: 8px; }
  .termin-card .termin-icon { width: 30px; height: 30px; font-size: 12px; }
  .submit { padding: 8px 16px; font-size: 12px; }
}

/* Tablet Portrait */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .login-box { max-width: 500px; padding: 30px; }
  .termin-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}

/* Tablet Landscape */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
  .login-box { max-width: 550px; padding: 35px; }
  .termin-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}

/* Sehr kleine Bildschirme */
@media (max-width: 320px) {
  .login-box {
    width: 100%;
    padding: 10px 5px;
    border-radius: 10px;
    margin: 5px;
  }
  .login-box h2{ font-size: 1rem; margin-bottom: 8px; }
  .login-box p { font-size: 0.75rem; margin-bottom: 8px; }
  .login-box .user-box input,
  .login-box .user-box select { padding: 5px 6px; font-size: 13px; margin-bottom: 6px; }
  .submit { font-size: 10px; padding: 5px 10px; }
  .btn-primary, .btn-secondary { font-size: 10px; padding: 5px 10px; }
  .termin-card { padding: 6px; }
  .termin-card .termin-header { gap: 4px; margin-bottom: 4px; }
  .termin-card .termin-icon { width: 20px; height: 20px; font-size: 8px; }
  .termin-card .termin-info h4 { font-size: 0.75rem; }
  .termin-card .termin-info p  { font-size: 0.6rem; }
}

/* Kritische sehr kleine Breiten/Höhen */
@media (max-width: 280px) {
  .login-box {
    margin: 10px;
    width: calc(100% - 20px);
    max-width: none;
    min-width: auto;
  }
  body, html { overflow-x: auto; overflow-y: auto; }
  .login-box h2{ font-size: 0.9rem; }
  .login-box p { font-size: 0.7rem; }
  .login-box .user-box input,
  .login-box .user-box select { font-size: 12px; padding: 4px 5px; }
  .submit { font-size: 9px; padding: 4px 8px; }
  .btn-primary, .btn-secondary { font-size: 9px; padding: 4px 8px; }
  .termin-card { padding: 4px; }
  .termin-card .termin-icon { width: 18px; height: 18px; font-size: 7px; }
  .termin-card .termin-info h4 { font-size: 0.7rem; }
  .termin-card .termin-info p  { font-size: 0.55rem; }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .login-box { border-width: 1px; }
  .login-box .user-box input,
  .login-box .user-box select { border-width: 1px; }
  .termin-card { border-width: 1px; }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .login-box,
  .submit,
  .btn-primary,
  .btn-secondary,
  .timeline-item,
  .login-box .user-box input,
  .login-box .user-box select,
  .termin-card {
    transition: none;
    animation: none;
  }
  .submit span { display: none; }
  .status-progress-bar::after { animation: none; }
}

/* High Contrast */
@media (prefers-contrast: high) {
  .login-box {
    border-width: 3px;
    box-shadow: 0 0 0 3px #FFFFFE;
  }
  .login-box .user-box input,
  .login-box .user-box select { border-width: 2px; }
  .submit, .btn-primary, .btn-secondary {
    border-width: 2px; border-color: #FFFFFE;
  }
  .termin-card { border-width: 2px; }
  .termin-card.selected { border-width: 3px; }
}

/* Touch Optimierungen */
@media (hover: none) and (pointer: coarse) {
  .termin-card:hover { transform: none; }
  .termin-card:active { transform: scale(0.98); }
  .submit:hover, .btn-primary:hover, .btn-secondary:hover { transform: none; }
  .submit:active, .btn-primary:active, .btn-secondary:active { transform: scale(0.98); }
}

.login-box .user-box select option[disabled][value=""] {
  color: rgba(255,255,254,0.6);
}

/* Label hoch, sobald der Select gültig ist (also echte Option gewählt) */
.login-box .user-box select:valid + label,
.card .user-box select:valid + label {
  color: #3AB0F8;
  transform: translateY(-50%) scale(1.05);
  background: rgba(16, 60, 97, 0.98);
  box-shadow: 0 2px 8px rgba(58, 176, 248, 0.3);
}

/* optional: solange noch kein Termin gewählt ist */
.login-box .user-box select:invalid {
  color: rgba(255,255,254,0.9);
}