*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: ui-sans-serif, system-ui, sans-serif;
    background: #f9fafb;
    color: #111827;
    min-height: 100vh;
}

/* ---- Start ---- */
.start-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.start-page h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.start-page .subtitle {
    color: #6b7280;
    margin-bottom: 3rem;
    text-align: center;
}

.card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

.card-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 14rem;
    height: 10rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    text-decoration: none;
    color: #374151;
    font-size: 1.1rem;
    font-weight: 600;
    transition: box-shadow .2s, border-color .2s, color .2s;
}

.card-link .icon { font-size: 2.8rem; margin-bottom: 0.75rem; }

.card-link.baeker:hover  { border-color: #f59e0b; color: #d97706; box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.card-link.mitarbeiter:hover { border-color: #3b82f6; color: #2563eb; box-shadow: 0 4px 12px rgba(0,0,0,.12); }

/* ---- Login ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-page.baeker     { background: #fffbeb; }
.login-page.mitarbeiter { background: #eff6ff; }

.login-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    padding: 2.5rem;
    width: 100%;
    max-width: 26rem;
}

.login-box .login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-box .login-header .icon { font-size: 3rem; display: block; margin-bottom: 0.75rem; }
.login-box .login-header h1    { font-size: 1.5rem; font-weight: 700; color: #1f2937; }

.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.35rem;
}

.form-group input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.form-group input:focus {
    border-color: transparent;
    box-shadow: 0 0 0 2px var(--accent, #f59e0b);
}

.login-page.baeker      { --accent: #f59e0b; }
.login-page.mitarbeiter { --accent: #3b82f6; }

.form-group .field-error { font-size: 0.75rem; color: #dc2626; margin-top: 0.25rem; }

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.btn-submit {
    width: 100%;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: background .2s;
}

.login-page.baeker      .btn-submit { background: #f59e0b; }
.login-page.baeker      .btn-submit:hover { background: #d97706; }
.login-page.mitarbeiter .btn-submit { background: #2563eb; }
.login-page.mitarbeiter .btn-submit:hover { background: #1d4ed8; }

.back-link {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    text-decoration: none;
}

.back-link:hover { color: #374151; }

.login-hint {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.4rem;
}

.input-code {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.4em;
}

.resend-link {
    font-size: 0.875rem;
    color: #6b7280;
    text-decoration: underline;
    cursor: pointer;
}

.resend-link:hover { color: #374151; }

/* ---- Shared page layout ---- */
.page-wrap {
    max-width: 56rem;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

.page-wrap--narrow {
    max-width: 42rem;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
}

.page-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.2rem;
}

.back-row {
    margin-top: 2rem;
}

/* ---- Alerts ---- */
.alert {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: 0.5rem 1.1rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background .2s, color .2s;
}

.btn-primary   { background: #f59e0b; color: #fff; }
.btn-primary:hover { background: #d97706; }

.btn-secondary { background: #e5e7eb; color: #374151; }
.btn-secondary:hover { background: #d1d5db; }

.btn-danger    { background: #fee2e2; color: #b91c1c; }
.btn-danger:hover { background: #fecaca; }

.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.825rem; }

/* ---- Brötchen list ---- */
.broetchen-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.broetchen-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.broetchen-card--link {
    text-decoration: none;
    color: inherit;
    transition: border-color .2s, box-shadow .2s;
}

.broetchen-card--link:hover {
    border-color: #f59e0b;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

.broetchen-card-body h2 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.broetchen-preview {
    font-size: 0.85rem;
    color: #6b7280;
}

.broetchen-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.broetchen-card-arrow {
    font-size: 1.25rem;
    color: #9ca3af;
    flex-shrink: 0;
}

/* ---- Empty state ---- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.empty-icon { font-size: 3rem; display: block; margin-bottom: 1rem; }
.empty-state p { margin-bottom: 1.25rem; }

/* ---- Card form ---- */
.card-form {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.form-group textarea {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    resize: vertical;
    transition: border-color .15s, box-shadow .15s;
}

.form-group textarea:focus,
.form-group input:focus {
    border-color: transparent;
    box-shadow: 0 0 0 2px #f59e0b;
}

.form-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 1.5rem 0;
}

.form-section-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ---- Brötchen detail (Mitarbeiter) ---- */
.broetchen-detail {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    margin-bottom: 1.5rem;
}

.broetchen-detail h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.25rem;
}

.detail-section { margin-bottom: 1.25rem; }

.detail-section h2 {
    font-size: 0.825rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.detail-text {
    font-size: 0.975rem;
    color: #374151;
    white-space: pre-line;
    line-height: 1.6;
}

.questions-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    margin-bottom: 1.5rem;
}

.questions-box h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.35rem;
}

.label-optional { font-weight: 400; color: #9ca3af; }

.form-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.dynamic-block {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.dynamic-block--inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
}

.dynamic-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.dynamic-block-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

.btn-remove {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    flex-shrink: 0;
}

.btn-remove:hover { color: #dc2626; }

.questions-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1.25rem;
}
