/* =============================================
   Eheseminar FECG Tostedt - Stylesheet
   Helles, modernes Design mit warmen Akzenten
   ============================================= */

:root {
    --primary: #5b7fa6;
    --primary-dark: #3d6080;
    --primary-light: #e8eff6;
    --accent: #c4956a;
    --accent-light: #f5ede5;
    --success: #5a9a6e;
    --danger: #c0504d;
    --text: #2d3436;
    --text-muted: #6c757d;
    --bg: #f5f3f0;
    --card-bg: #ffffff;
    --border: #e0ddd8;
    --border-light: #f0ede8;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.2s ease;
}

/* =============================================
   Base
   ============================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    margin: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
}

h2 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* =============================================
   Blazor Error UI
   ============================================= */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 3.5rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iP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3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "Ein Fehler ist aufgetreten."
}

/* =============================================
   Modern Navigation
   ============================================= */
.site-nav {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

.nav-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1.1rem;
    transition: var(--transition);
}

.nav-brand:hover {
    color: var(--primary);
    text-decoration: none;
}

.nav-brand img {
    height: 34px;
    width: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition);
}

.nav-link:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
    text-decoration: none;
}

.nav-link svg {
    opacity: 0.7;
    flex-shrink: 0;
}

.nav-link-logout:hover {
    background: #fdf0f0;
    color: var(--danger);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-toggle:hover {
    background: var(--primary-light);
}

.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

/* =============================================
   Wizard / ProgressBar
   ============================================= */
.wizard {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding: 1.5rem 0 0.5rem;
}

.wizard-step {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 2;
    cursor: default;
}

.wizard-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 18px;
    left: 50%;
    width: 100%;
    height: 3px;
    background-color: var(--border);
    z-index: 1;
    border-radius: 2px;
}

.wizard-circle {
    position: relative;
    z-index: 3;
    width: 36px;
    height: 36px;
    line-height: 36px;
    border-radius: 50%;
    background-color: var(--border);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    text-align: center;
    transition: var(--transition);
}

.wizard-label {
    position: relative;
    z-index: 3;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
}

.wizard-step.completed .wizard-circle {
    background-color: var(--success);
}

.wizard-step.completed .wizard-circle:hover {
    background-color: var(--primary);
    transform: scale(1.1);
    cursor: pointer;
}

.wizard-step.completed .wizard-label {
    color: var(--text);
}

.wizard-step.completed:not(:last-child)::after {
    background-color: var(--success);
}

.wizard-step.active .wizard-circle {
    background-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.wizard-step.active .wizard-label {
    color: var(--primary-dark);
    font-weight: 600;
}

.wizard-step.upcoming .wizard-circle {
    background-color: var(--border);
}

.wizard-step.upcoming .wizard-label {
    color: var(--text-muted);
}

/* =============================================
   Form Styles
   ============================================= */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.form-group .required-star {
    color: var(--danger);
    margin-left: 2px;
}

input.form-control,
.form-control {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0.7rem 0.9rem;
    font-size: 1rem;
    line-height: 1.5;
    box-sizing: border-box;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    color: var(--text);
    transition: var(--transition);
}

input.form-control:focus,
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}

input.form-control::placeholder {
    color: #b0aaa0;
}

input.invalid,
.form-control.invalid,
.validation-message {
    color: var(--danger);
}

input.invalid,
.form-control.invalid {
    border-color: var(--danger);
}

.validation-message {
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.validation-summary-errors {
    background: #fdf0f0;
    border: 1px solid #f0c0c0;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: var(--danger);
    font-size: 0.9rem;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 1.2rem;
}

/* =============================================
   Buttons
   ============================================= */
button.btn,
a.btn {
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-lg {
    padding: 0.85rem 2.5rem;
    font-size: 1.05rem;
}

button.btn-primary,
a.btn-primary {
    background-color: var(--primary);
    color: #fff;
}

button.btn-primary:hover,
a.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(91, 127, 166, 0.3);
}

button.btn-primary:active {
    transform: translateY(0);
}

button.btn-success {
    background-color: var(--success);
    color: #fff;
}

button.btn-success:hover {
    opacity: 0.9;
}

a.btn-warning {
    background-color: #FFC439;
    color: #2C2E2F;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

a.btn-warning:hover {
    background-color: #e6b035;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 196, 57, 0.3);
}

button.btn-outline {
    background: var(--card-bg);
    border: 2px solid var(--border);
    color: var(--text);
    padding: 0.55rem 1.2rem;
    font-size: 0.9rem;
}

button.btn-outline:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}

button.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* =============================================
   Cards / Info Boxes
   ============================================= */
.info-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 0.85rem;
    transition: var(--transition);
}

.info-card:hover {
    box-shadow: var(--shadow);
    border-left-color: var(--accent);
}

.info-card h5 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0 0 0.3rem 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.info-card p {
    margin: 0;
    font-size: 1rem;
    color: var(--text);
    line-height: 1.5;
}

.info-card a {
    font-weight: 500;
}

/* =============================================
   Copy Field (Confirmation Page)
   ============================================= */
.copy-container {
    display: flex;
    align-items: stretch;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 1rem 0;
    background: var(--card-bg);
}

.copy-text {
    flex: 1;
    padding: 0.75rem 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    user-select: all;
    word-break: break-word;
    border: none;
    background: transparent;
}

.copy-btn {
    padding: 0.75rem 1.25rem;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    white-space: nowrap;
}

.copy-btn:hover {
    background: var(--primary-dark);
}

.copy-btn.copied {
    background: var(--success);
}

/* =============================================
   Children Section
   ============================================= */
.children-section {
    background: var(--accent-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 0.5rem;
}

.child-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.child-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.child-row .child-name {
    flex: 3;
}

.child-row .child-age {
    flex: 1;
    min-width: 80px;
}

.child-row .child-number {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-bottom: 0.8rem;
    white-space: nowrap;
}

/* =============================================
   Spinner
   ============================================= */
.spinner-container {
    display: inline-flex;
    align-items: center;
    margin-left: 12px;
    vertical-align: middle;
}

.spinner {
    border: 3px solid var(--border);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border-left-color: var(--primary);
    animation: spin 0.8s ease infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =============================================
   Alerts
   ============================================= */
.alert {
    border-radius: var(--radius-sm);
    padding: 0.9rem 1.2rem;
    font-size: 0.95rem;
    border: none;
}

.alert-danger {
    background: #fdf0f0;
    color: var(--danger);
    border-left: 4px solid var(--danger);
}

.alert-success {
    background: #f0faf3;
    color: var(--success);
    border-left: 4px solid var(--success);
}

.alert-info {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-left: 4px solid var(--primary);
}

/* =============================================
   Welcome / Info Page
   ============================================= */
.page-hero {
    text-align: center;
    padding: 1rem 0 1.5rem;
}

.page-hero h2 {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.page-hero p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* =============================================
   Payment Section
   ============================================= */
.payment-section {
    background: var(--accent-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.payment-section h5 {
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.paypal-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: #FFC439;
    color: #2C2E2F;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.paypal-btn:hover {
    background: #e6b035;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 196, 57, 0.3);
    color: #2C2E2F;
    text-decoration: none;
}

.paypal-btn img {
    height: 22px;
}

/* =============================================
   Admin Stats Grid
   ============================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow);
}

.stat-card-highlight {
    background: var(--primary-light);
    border-color: var(--primary);
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1.2;
}

.stat-card-highlight .stat-number {
    color: var(--primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 0.2rem;
}

/* Admin Actions */
.admin-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* =============================================
   Admin / Registrations Table
   ============================================= */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.registrations-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 650px;
}

.registrations-table thead th {
    background: var(--primary);
    color: #fff;
    padding: 0.85rem 1rem;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.registrations-table thead th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.registrations-table thead th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.registrations-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.93rem;
    vertical-align: middle;
}

.registrations-table tbody tr {
    transition: var(--transition);
}

.registrations-table tbody tr:hover {
    background: var(--primary-light);
}

.registrations-table tbody tr:last-child td {
    border-bottom: none;
}

.registrations-table .col-num {
    width: 45px;
    text-align: center;
    color: var(--text-muted);
    font-weight: 600;
}

.registrations-table .col-center {
    text-align: center;
}

.registrations-table .col-email {
    font-size: 0.88rem;
    word-break: break-all;
}

.registrations-table .col-date {
    white-space: nowrap;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    border-radius: 20px;
    padding: 0.15rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 26px;
}

/* =============================================
   Print Styles
   ============================================= */
@media print {
    .site-nav, .footer, .admin-actions, .nav-toggle,
    .wizard, button, .btn {
        display: none !important;
    }

    .content-wrapper {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    .table-container {
        border: none;
        box-shadow: none;
        overflow: visible;
    }

    .registrations-table {
        min-width: auto;
    }

    .registrations-table thead th {
        background: #eee !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .stat-card {
        border: 1px solid #ccc;
    }
}

/* =============================================
   Responsive
   ============================================= */

/* Tablet */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--card-bg);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
        flex-direction: column;
        padding: 0.5rem;
        gap: 0;
        z-index: 99;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-link {
        padding: 0.75rem 1rem;
        border-radius: var(--radius-sm);
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 576px) {
    .wizard-label {
        font-size: 0.7rem;
    }

    .wizard-circle {
        width: 30px;
        height: 30px;
        line-height: 30px;
        font-size: 0.8rem;
    }

    .wizard-step:not(:last-child)::after {
        top: 15px;
    }

    .child-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .child-row .child-number {
        padding-bottom: 0;
    }

    h2 {
        font-size: 1.4rem;
    }

    .page-hero h2 {
        font-size: 1.5rem;
    }

    .copy-container {
        flex-direction: column;
    }

    .copy-btn {
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .stat-number {
        font-size: 1.4rem;
    }

    .admin-actions {
        flex-direction: column;
    }

    .admin-actions .btn {
        justify-content: center;
    }

    .info-card {
        padding: 0.85rem 1rem;
    }
}
