/* Mobile-first optimizations */
@media (max-width: 768px) {

  /* Date Input Width Fix (iOS/Android native date picker) */
  input[type="date"],
  input[type="date"][data-mobile-date],
  #tarifwizard input[type="date"] {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: block;
  }
  input[type="date"]::-webkit-date-and-time-value {
    text-align: left;
  }

  /* Header / Logo */
  .navbar {
    padding-bottom: 12px !important;
  }
  .navbar img {
    height: 48px !important;
    top: 0 !important;
    position: relative !important;
  }

  /* Hero */
  .hero {
    padding-top: 32px !important;
  }
  .hero h1 {
    font-size: 2rem !important;
    line-height: 1.2 !important;
  }
  .hero p {
    font-size: 1rem !important;
  }
  .hero .row {
    flex-direction: column-reverse;
    text-align: center;
  }
  .hero .card {
    margin-bottom: 24px;
  }

  /* Buttons */
  .btn-lg {
    width: 100%;
  }

  /* Tarifrechner */
  .wizard-card {
    border-radius: 20px !important;
    padding: 16px !important;
  }

  /* Forms */
  input, select, textarea {
    font-size: 16px !important; /* prevent iOS zoom */
  }

  /* Cards spacing */
  .card {
    margin-bottom: 16px;
  }
}


/* =========================
   Mobile UI upgrades (v88)
   ========================= */
@media (max-width: 768px){
  html, body{ width:100%; overflow-x:hidden; }
  /* Reserve space for sticky CTA / iOS safe-area */
  body{ padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .container{ padding-left:16px !important; padding-right:16px !important; }
  .card, .hero-card, .faq-surface{ border-radius:18px !important; }
  h1{ font-size:1.75rem !important; line-height:1.15 !important; }
  h2{ font-size:1.35rem !important; }
  .lead{ font-size:1.05rem !important; }

  /* Make forms truly 1-column on mobile */
  .row.g-4 > [class*="col-"], .row.g-3 > [class*="col-"]{ width:100% !important; max-width:100% !important; }
  .form-control, .form-select, textarea, input, button{ font-size:16px !important; }
  .form-control, .form-select, textarea, input{ min-height:48px !important; border-radius:14px !important; }
  button, .btn{ min-height:52px !important; border-radius:16px !important; }
  .btn.btn-outline-primary{ min-height:48px !important; }

  /* Sticky CTA bar for wizard actions */
  .wizard-actions{
    position: sticky;
    bottom: 0;
    z-index: 40;
    background: rgba(255,255,255,.92);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(226,232,240,.9);
    margin-left: -16px;
    margin-right: -16px;
    display:flex;
    gap:10px;
  }
  .wizard-actions .btn{ flex:1; }
  .wizard-actions .btn#backToNotice{ flex:0 0 42%; }
  .wizard-actions .btn#showTariffs{ flex:1; }

  /* Tariff cards (recommendations) */
  .tariff-card{
    border:1px solid #e5e7eb !important;
    border-radius:18px !important;
    box-shadow: 0 10px 24px rgba(2,6,23,.06) !important;
    padding:16px !important;
  }
  .tariff-card.bestseller{
    border-color:#60a5fa !important;
    box-shadow: 0 14px 30px rgba(37,99,235,.16) !important;
  }
  .tariff-price{ font-size:28px !important; }
  .tariff-name{ font-size:18px !important; }

  /* FAQ accordion polish */
  .faq-section .accordion-item{
    border:1px solid #e5e7eb !important;
    border-radius:16px !important;
    overflow:hidden;
    margin-bottom:10px;
    background:#fff;
  }
  .faq-section .accordion-button{
    padding:14px 16px !important;
    font-weight:700;
    background:#fff !important;
    border:0 !important;
    box-shadow:none !important;
    white-space: normal;
    text-align: left;
  }
  .faq-section .accordion-button:not(.collapsed){
    color:#0f172a !important;
  }
  .faq-section .accordion-body{
    padding:0 16px 14px 16px !important;
    color:#334155;
    line-height:1.55;
  }


  /* === Full-width FAQ on mobile === */
  .faq-section .container{
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .faq-section .row.justify-content-center .col-lg-8{
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }
  .faq-section .faq-surface{
    width: 100% !important;
    max-width: 100% !important;
  }

  /* === Full-width Kontaktformular on mobile === */
  .container.py-5{
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .container.py-5 > .row{
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .container.py-5 > .row > [class^="col-"],
  .container.py-5 > .row > [class*=" col-"]{
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .container.py-5 .card{
    width: 100% !important;
    border-radius: 0 !important;
  }
  .container.py-5 .card-body{
    padding: 16px !important;
  }

}
/* ---- Smaller Info Icon (Mobile + Desktop) ---- */
.info-icon,
.info-btn,
.tarif-info-icon,
.leistung-info-icon {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  font-size: 14px !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}


/* Fix: Date input can overflow card on iOS (Tarifwizard) */
@media (max-width: 768px) {

  /* Date Input Width Fix (iOS/Android native date picker) */
  input[type="date"],
  input[type="date"][data-mobile-date],
  #tarifwizard input[type="date"] {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: block;
  }
  input[type="date"]::-webkit-date-and-time-value {
    text-align: left;
  }
  #tarifwizard input[type="date"]{
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: block;
  }
}

/* ==========================================
   FINAL iOS Safari Date Input Width Fix
   ========================================== */
@media (max-width: 768px) {

  #tarifwizard input[type="date"],
  #antrag input[type="date"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    display: block !important;
    -webkit-appearance: none !important;
    appearance: none !important;
  }

  #tarifwizard input[type="date"]::-webkit-date-and-time-value,
  #antrag input[type="date"]::-webkit-date-and-time-value {
    text-align: left;
  }

}



/* Hide single person info text */
#addPersonHint,
.single-person-info {
    display: none !important;
}



/* ===== Mobile Fix: Versicherungsbeginn Breite ===== */
@media (max-width: 768px) {

  input[type="month"],
  input[name="insurance_start"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    display: block !important;
  }

  /* Falls Parent Padding Probleme macht */
  .rounded-2xl input[type="month"] {
    width: 100% !important;
  }

}


/* Fix: Mobile Tarifvergleich - lange Texte werden abgeschnitten (z.B. Bleaching) */
@media (max-width: 768px){
  #tariffCompareMobile .rounded-xl{
    height:auto !important;
    min-height: 72px; /* genug für mehrere Zeilen */
    overflow: visible !important;
  }
  #tariffCompareMobile .rounded-xl > div{
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.25 !important;
  }
}


/* ===== Mobile Tarifvergleich: bessere Umbrüche ===== */
@media (max-width: 768px) {
  #tariffCompareMobile .compare-val,
  #tariffCompareMobile .text-slate-700,
  #tariffCompareMobile .font-semibold {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    hyphens: auto !important;
    line-height: 1.25 !important;
  }

  #tariffCompareMobile .rounded-xl {
    height: auto !important;
  }
}


@media (max-width: 768px){
  .faq-highlight{
    padding:16px !important;
    border-radius:18px !important;
    box-shadow:0 12px 28px rgba(34,183,214,.14) !important;
  }
  .faq-highlight .faq-summary{
    display:flex !important;
    align-items:flex-start !important;
    gap:12px;
  }
  .faq-highlight .faq-summary > span:first-child{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:8px;
    padding-right:8px;
  }
  .faq-badge{
    margin-left:0;
    margin-top:2px;
  }
}
