:root {
    --primary: #8C5E58; /* Brick Red */
    --secondary: #1A1A1A; /* Anthracite */
    --accent: #D48166; /* Sunset Glow */
    --text-primary: #1A1A1A;
    --text-body: #333333;
    --background: #FDFDFD;
    --card-bg: #FFFFFF;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: #F5F5F5;
    color: var(--text-body);
    line-height: 1.6;
    padding: 4rem 1rem;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

header {
    text-align: center;
    margin-bottom: 3rem;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 2rem;
}

h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    font-weight: 800;
}

.subtitle {
    color: var(--secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.5rem;
}

section {
    margin-bottom: 3rem;
}

h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.form-group {
    margin-bottom: 2rem;
    position: relative;
    transition: transform 0.2s;
}

.form-group:hover {
    transform: translateX(5px);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-row .col {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-row .col > .form-control {
    margin-top: auto;
}

.download-container {
    background: var(--background);
    padding: 1.5rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.download-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--secondary);
    color: white;
    width: 100%;
    padding: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

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

.btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 1px solid var(--primary);
    font-size: 0.85rem;
}

.btn-secondary:hover {
    background: var(--accent);
}

/* Alert/Flash Messages */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-danger {
    background-color: #F8D7DA;
    color: #721C24;
    border: 1px solid #F5C6CB;
}

.alert-success {
    background-color: #D4EDDA;
    color: #155724;
    border: 1px solid #C3E6CB;
}

.hidden {
    display: none;
}

.visible {
    display: inline-block;
}

.form-actions {
    margin-top: 2rem;
    text-align: center;
}

.upload-area {
    border: 2px dashed #D1D1D1;
    padding: 3rem;
    text-align: center;
    border-radius: 8px;
    background: #FFFFFF;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.upload-area:hover {
    border-color: var(--accent);
    background: rgba(212, 129, 102, 0.05);
}

.upload-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
}

.file-input {
    display: none;
}

.upload-hint {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.8rem;
}

/* Signature Pad Styling */
.signature-section {
    background: #FAFAFA;
    border-radius: 12px;
    padding: 2.5rem;
    border: 1px solid #EAEAEA;
    margin-top: 3rem;
}

.legal-scrollbox {
    height: 180px;
    overflow-y: scroll;
    border: 1px solid #D1D1D1;
    padding: 1.5rem;
    font-size: 0.85rem;
    line-height: 1.6;
    background: #FFF;
    margin-bottom: 2rem;
    border-radius: 4px;
    color: #444;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.signature-wrapper {
    border: 1px solid #D1D1D1;
    background: #FFFFFF;
    width: 100%;
    height: 220px;
    position: relative;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.signature-wrapper::after {
    content: "UNTERSCHRIFT HIER";
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: #BBB;
    letter-spacing: 0.2em;
    pointer-events: none;
    border-top: 1px solid #EEE;
    width: 80%;
    text-align: center;
    padding-top: 5px;
}

/* Tooltip Styles */
.has-tooltip {
    position: relative;
}

.tooltip-text {
    visibility: hidden;
    width: 250px;
    background-color: var(--primary);
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 8px;
    position: absolute;
    z-index: 100;
    bottom: 105%;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.75rem;
    font-family: 'Open Sans', sans-serif;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.has-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Intro & Alerts */
.intro-guide {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--accent);
}

.intro-guide h2 {
    border-bottom: none;
    margin-bottom: 1rem;
}

.alert-info {
    background-color: var(--accent);
    border-left: 4px solid var(--primary);
    padding: 1.5rem;
    border-radius: 4px;
    margin: 1.5rem 0;
}

.alert-info ol {
    margin-top: 1rem;
    margin-left: 1.5rem;
}

.alert-info li {
    margin-bottom: 0.5rem;
}

.help-icon-inline {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
}

/* Signature canvas: prevent page scroll while drawing */
#signature-pad {
    touch-action: none;
    width: 100%;
    height: 100%;
}

/* --- Pill Grid --- */
.pill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.pill {
    background: rgba(212, 129, 102, 0.1);
    color: var(--secondary);
    border: 1px solid rgba(212, 129, 102, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: default;
}

.pill:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(212, 129, 102, 0.2);
}

/* --- Marquee Ticker --- */
.marquee-container {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    background: var(--secondary);
    color: #fff;
    padding: 1.5rem 0;
    margin-bottom: 4rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.marquee-content {
    display: inline-flex;
    animation: marquee 60s linear infinite;
}

.marquee-item {
    padding: 0 2rem;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.marquee-item::after {
    content: "•";
    color: var(--accent);
    margin-left: 4rem;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}


@media (max-width: 600px) {
    body {
        padding: 1rem 0.5rem;
    }

    .container {
        padding: 1.5rem;
        border-radius: 0;
    }

    h1 {
        font-size: 1.6rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

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

    /* Disable hover-shift on touch devices to prevent horizontal overflow/scroll-trap */
    .form-group:hover {
        transform: none;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .tooltip-text {
        width: 200px;
        left: 0;
        bottom: 110%;
    }

    /* Expand legal text fully on mobile — no nested scroll trap */
    .legal-scrollbox {
        height: auto;
        max-height: none;
        overflow-y: visible;
    }

    .admin-container {
        padding: 1rem;
        margin: 0;
        border-radius: 0;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .login-card {
        width: 95%;
        padding: 2rem 1.5rem;
    }
}
