:root {
    --bg: #f6f7fb;
    --card: #ffffff;
    --accent: #1f6feb;
    --ok: #0a8a4f;
    --warn: #d97706;
    --err: #e02424;
}


* {
    box-sizing: border-box;
}

body {
    font-family: Inter, system-ui, Segoe UI, Roboto, "Helvetica Neue", Arial;
    margin: 0;
    background: var(--bg);
    color: #0b1220;
    padding: 10rem 2rem 4rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
}


html, body {
    overscroll-behavior-x: none;   
    overflow-x: hidden;           
  }


/* Typographie */

h1 {
    margin: 0 0 8px;
    font-size: 2.5rem;
    letter-spacing: -0.04rem;
    text-align: center;
}

h2 {
    margin: 0 0 20px;
    font-size: 1.75rem;
    padding-bottom: 6px;
}

h3 {
    margin-top: 45px;
    font-size: 1.5rem;
    padding-bottom: 4px;
}

p {
    font-size: 1.125rem;
    line-height: 1.6;
    width: 600px;
    max-width: 90vw;
}

p.lead {
    margin: 8px 0 18px;
    color: #374151;
}

ul {
    padding-left: 20px;
    width: 600px;
    max-width: 90vw;
    margin-bottom: 15px;
}

li {
    margin-bottom: 10px;
    font-size: 1.125rem;
}

/* Layout */

.wrap {
    max-width: 920px;
    margin: 28px auto;
    padding: 20px;
}

header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.card {
    background: var(--card);
    border: 1px solid #686868;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 6px 18px rgba(11, 18, 32, 0.06);
    margin-bottom: 15px;
}

.grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.preview {
    background: #f8f9fb;
    padding: 8px;
    border-radius: 6px;
    margin-top: 8px;
}

/* Formular */

label {
    display: block;
    font-weight: 600;
    min-width: 160px;
}

.field {
    margin-bottom: 12px;
}

fieldset {
    border: 1px solid #a5a5a5;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 25px;
}

select,
input[type="text"] {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #5a5a5a;
}

.subjects {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.course-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 6px 0;
}

/* Buttons */

.controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

button,
.btn {
    padding: 10px 12px;
    border-radius: 8px;
    border: 0;
    cursor: pointer;
    background: var(--accent);
    color: white;
}

button {
    padding: 8px 20px;
    border-radius: 15px;
}

.btn.ghost {
    background: transparent;
    border: 1px solid #b9b9b9;
    color: var(--accent);
    margin-left: 10px;
    margin: 15px 0 15px 10px;
}

.subj-btn {
    background: #f3f6ff;
    border: 1px solid rgba(31, 111, 235, 0.12);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
}

.learn-more-link {
    background: none;
    border: none;
    color: var(--accent);
    text-decoration: underline;
    cursor: pointer;
    font-size: 1em;
    padding: 0;
    font-family: inherit;
}

/* Wizard */

#wizard {
    position: relative;
    margin-top: 50px;
    border: 1px solid #7c7c7c;
    border-radius: 8px;
    width: 600px;
    max-width: 90vw;
    min-height: 450px;
    padding-bottom: 2rem;
}

.step {
    display: none;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.step.active {
    display: block;
}

.buttons {
    position: absolute;
    bottom: 16px;
    left: 16px;
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Statusnachrichten */

.status {
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
}

.status.ok {
    background: rgba(10, 138, 79, 0.08);
    color: var(--ok);
    border: 1px solid rgba(10, 138, 79, 0.12);
}

.status.warn {
    background: rgba(217, 119, 6, 0.06);
    color: var(--warn);
    border: 1px solid rgba(217, 119, 6, 0.1);
}

.status.err {
    background: rgba(224, 36, 36, 0.06);
    color: var(--err);
    border: 1px solid rgba(224, 36, 36, 0.1);
}

.hint {
    font-size: 1em;
    color: #444;
    text-align: left;
    max-width: 90%;
}

ul.suggestions {
    margin: 8px 0;
    padding-left: 18px;
}

/* Tabelle */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

th,
td {
    border: 1px solid #888888;
    padding: 3px !important;
    text-align: center;
}

th {
    background: #f7f7f7;
}

/* Info-Popup */

/* Overlay */
.info-popup {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    background-color: rgba(255,255,255,0.98);
    padding: env(safe-area-inset-top, 1rem) env(safe-area-inset-right, 1rem) env(safe-area-inset-bottom, 1rem) env(safe-area-inset-left, 1rem);
    touch-action: auto;
    overflow-x: hidden; 
    box-sizing: border-box;
  }
  
  .info-wrapper {
    width: min(600px, calc(100% - 2rem));
    max-width: 100%;
    max-height: calc(100dvh - 2rem);
    border-radius: 12px;
    overflow-y: auto;
    overflow-x: hidden; 
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    background: var(--card);
    box-shadow: 0 6px 18px rgba(11, 18, 32, 0.06);
    margin: 0 auto; 
  }
  
  .info-wrapper, .info-wrapper * {
    box-sizing: border-box;
    max-width: 100%;
    word-break: break-word;
  }

.info-content {
    margin: 5% auto;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
  

/* Utility */

.hidden {
    display: none;
}

.danger { color: #b00; }
.ok { color: #080; }
.small { font-size: 0.9em; }

.chip {
    display: inline-block;
    padding: 4px 8px;
    background: #f0f0f0;
    border-radius: 999px;
    margin-left: 8px;
}

.greyed { color: #999; }
.disabled { opacity: 0.6; }
.left { text-align: left; }
.muted { color: #666; font-size: 0.9em; }

.meta {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 10px;
}

body.modal-lock { 
    position: fixed;    
    inset: 0;
    width: 100%;
    overflow: hidden;
  }

.mobile-break {
    display: inline;
}

/* Footer */

footer {
    height: 10vh;
    margin-top: 16px;
    text-align: center;
    font-size: 0.85rem;
    color: #6b7280;
    position: relative;
}

.credit {
    width: 100%;
}


/* Media Queries */

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

    .subjects {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 900px) {
    h1 {
        font-size: 3rem;
        letter-spacing: -0.03rem;
    }
    th,
    td {
        padding: 6px;
    }
    .mobile-break { 
        display: none;
    }
}

@media print {
    * {
        overflow: visible !important;
    }

    .info-container {
      display: none;
      margin: 0;
      padding: 0;
    }
  
    #result {
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
    }
  
    button {
      display: none !important;
    }

    .credit {
        visibility: hidden;
    }

    #wizard {
        border: none !important;
        padding: 0;
        margin: 0;
    }

    h2 {
        display: none;
    }

  }
  