/* =====================================================
   Health365 AC GmbH – Design System
   Farben:
     Primär-Blau:    #1A5EA6
     Akzent-Grün:    #4AAD3A
     Akzent-Orange:  #E85920
     Dunkel:         #2C3E50
     Hintergrund:    #F5F7FA
     Karte:          #FFFFFF
     Border:         #DDE3EC
   ===================================================== */

/* ---- Fonts ---- */
@font-face {
    font-family: 'Manrope';
    src: url('/fonts/Manrope-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary:      #1A5EA6;
    --primary-dark: #134a84;
    --accent-green: #4AAD3A;
    --accent-orange:#E85920;
    --dark:         #2C3E50;
    --text:         #374151;
    --text-light:   #6B7280;
    --bg:           #F5F7FA;
    --card:         #FFFFFF;
    --border:       #DDE3EC;
    --danger:       #DC2626;
    --success:      #16A34A;
    --radius:       10px;
    --shadow:       0 2px 12px rgba(26, 94, 166, 0.10);
    --shadow-lg:    0 4px 24px rgba(26, 94, 166, 0.16);
    --header-h:     70px;
    --footer-h:     52px;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Manrope', Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: var(--header-h);
    padding-bottom: var(--footer-h);
    line-height: 1.5;
}

/* ---- Header ---- */
.header, header.site-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 0 20px;
    width: 100%;
    height: var(--header-h);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-brand img {
    height: 44px;
    object-fit: contain;
    background: white;
    border-radius: 6px;
    padding: 4px 6px;
}

.header-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.3px;
}

.header-subtitle {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.8);
    font-weight: 400;
}

/* ---- Footer ---- */
.footer, footer.site-footer {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: rgba(255,255,255,0.85);
    text-align: center;
    padding: 0 20px;
    height: var(--footer-h);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 1000;
}

/* ---- Main / Layout ---- */
main, .main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 24px 16px;
    gap: 20px;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    margin-bottom: 8px;
}

/* ---- Card / Panel ---- */
.card, .wizard-container, #login-form, .form-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow);
}

.card h3, .form-panel h3 {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    text-align: center;
}

/* ---- Formular ---- */
form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--dark);
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    padding: 11px 14px;
    font-size: 1rem;
    font-family: inherit;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    width: 100%;
    background: white;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 94, 166, 0.12);
}

input:not([type="checkbox"]):not([type="radio"]):disabled,
select:disabled,
textarea:disabled {
    background: #F0F3F8;
    color: var(--text-light);
    cursor: not-allowed;
}

input::placeholder, textarea::placeholder {
    color: #9CA3AF;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

textarea#description {
    min-height: 120px;
}

/* ---- Buttons ---- */
button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 22px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    min-height: 46px;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

button:hover, .btn:hover {
    background-color: var(--accent-green);
    box-shadow: 0 2px 8px rgba(74, 173, 58, 0.3);
}

button:active, .btn:active {
    transform: scale(0.98);
}

button:disabled, .btn:disabled {
    background-color: #9CA3AF;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-full {
    width: 100%;
}

.btn-secondary {
    background-color: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background-color: var(--primary);
    color: white;
}

.btn-danger {
    background-color: var(--danger);
}
.btn-danger:hover {
    background-color: #b91c1c;
}

/* Navigations-Buttons (Zurück/Weiter) */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.nav-buttons button {
    flex: 1;
    min-width: 120px;
}

/* Volle Breite unter zentriertem main (verhindert schmale „Säule“ und Layout-Kollisionen) */
main > .page-wrap {
    align-self: stretch;
    width: 100%;
}

/* Oben auf Unterseiten: einheitlich „Zurück zum Menü“ (zentriert, umbrechend) */
.page-back-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}
.page-back-nav .btn,
.page-back-nav .btn-secondary {
    flex: 0 1 auto;
    max-width: 100%;
}

/* ---- Wizard ---- */
.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
}

.wizard-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.wizard-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    transition: background 0.3s;
}

.wizard-dot.active {
    background: var(--primary);
}

.wizard-dot.done {
    background: var(--accent-green);
}

/* ---- Buttons (Wizard-Nav) ---- */
.buttons {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.buttons button {
    flex: 1;
    min-width: 110px;
    padding: 11px 16px;
}

/* ---- Menü ---- */
.menu-container {
    width: 100%;
    max-width: 420px;
    text-align: center;
    padding: 28px 24px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.menu-container h2 {
    color: var(--dark);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.menu-container h2 span {
    color: var(--primary);
    font-weight: 700;
}

.menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu li {
    width: 100%;
}

.menu .btn {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    border-radius: 8px;
    background-color: var(--primary);
}

.menu .btn:hover {
    background-color: var(--accent-green);
}

/* ---- Tabellen ---- */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: white;
}

th, td {
    border: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
}

th {
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

tr:nth-child(even) {
    background-color: #F8FAFD;
}

tr:hover {
    background-color: #EEF4FC;
}

/* ---- Cards Grid (Unternehmensprofil) ---- */
.container {
    width: 100%;
    max-width: 860px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.card {
    padding: 20px;
    border-left: 4px solid var(--primary);
}

.card h3 {
    text-align: left;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    margin-bottom: 14px;
}

.card .buttons {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

.card .buttons button {
    flex: 0 1 auto;
    min-width: auto;
    padding: 8px 14px;
    font-size: 0.85rem;
}

/* ---- Passwort-Stärke (NIS2) ---- */
.password-strength {
    margin-top: 4px;
}

.strength-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
    width: 0%;
}

.strength-fill.weak   { width: 25%; background: var(--danger); }
.strength-fill.fair   { width: 50%; background: var(--accent-orange); }
.strength-fill.good   { width: 75%; background: #EAB308; }
.strength-fill.strong { width: 100%; background: var(--accent-green); }

.strength-text {
    font-size: 0.78rem;
    color: var(--text-light);
}

.password-rules {
    list-style: none;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.password-rules li::before {
    content: '✗ ';
    color: var(--danger);
}

.password-rules li.ok::before {
    content: '✓ ';
    color: var(--accent-green);
}

.password-rules li.ok {
    color: var(--accent-green);
}

/* ---- DSGVO / Consent ---- */
.consent-box {
    background: #EEF4FC;
    border: 1px solid #BFD5EE;
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 0.85rem;
    color: var(--text);
}

.consent-box a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 10px;
}

.checkbox-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
    border: 2px solid var(--border);
    border-radius: 4px;
    flex-shrink: 0;
}

.checkbox-row label {
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.4;
}

/* ---- Checkbox Gruppen ---- */
.checkbox-group, .bnbox-group2 {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-group label, .bnbox-group2 label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

/* ---- Feedback / Alerts ---- */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
}

.alert-success {
    background: #DCFCE7;
    border: 1px solid #BBF7D0;
    color: var(--success);
}

.alert-error {
    background: #FEE2E2;
    border: 1px solid #FECACA;
    color: var(--danger);
}

.alert-info {
    background: #DBEAFE;
    border: 1px solid #BFDBFE;
    color: var(--primary);
}

/* Inline-Error unter Feldern */
.field-error {
    font-size: 0.78rem;
    color: var(--danger);
    margin-top: 2px;
}

/* ---- Unternehmensprofil ---- */
.uprofil-button {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* ---- Greeting ---- */
.greeting {
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    padding-bottom: 8px;
}

/* ---- Sicherheitswarnung ---- */
.fatal-accident-warning {
    display: none;
    background: #FEE2E2;
    border: 1px solid var(--danger);
    border-radius: 8px;
    padding: 12px;
    color: var(--danger);
    font-weight: 700;
    margin-top: 10px;
}

/* ---- Session-Timeout Banner ---- */
#session-warning {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: #FEF3C7;
    border-bottom: 2px solid #F59E0B;
    color: #92400E;
    text-align: center;
    padding: 10px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    z-index: 999;
}

/* ---- Step-Indikator ---- */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 20px;
    font-size: 0.82rem;
    color: var(--text-light);
    font-weight: 600;
}

.step-indicator .step-num {
    background: var(--primary);
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    :root {
        --header-h: 60px;
        --footer-h: 48px;
    }

    .header-title {
        font-size: 0.95rem;
    }

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

    .card, .wizard-container, #login-form, .form-panel {
        max-width: 100%;
        padding: 18px;
    }

    .menu-container {
        max-width: 100%;
    }

    table {
        font-size: 0.8rem;
    }

    th, td {
        padding: 8px 10px;
    }

    .nav-buttons, .buttons {
        flex-direction: column;
    }

    .nav-buttons button, .buttons button {
        width: 100%;
        flex: unset;
    }
}

@media (max-width: 480px) {
    body {
        padding-left: 0;
        padding-right: 0;
    }

    main, .main {
        padding: 16px 12px;
    }

    button, .btn {
        font-size: 0.95rem;
        padding: 12px 16px;
    }

    .header-brand img {
        height: 36px;
    }

    .page-title {
        font-size: 1.2rem;
    }
}
