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

:root {
    /* Dark Theme mit mybookhub Branding */
    --primary-color: #8B5CF6;  /* Helles Lila */
    --primary-light: #A78BFA;
    --primary-dark: #6B46C1;
    --secondary-color: #10B981;  /* Grün */
    --secondary-light: #34D399;
    --success-color: #10B981;
    --error-color: #F87171;
    --text-color: #F9FAFB;
    --text-light: #D1D5DB;
    --text-muted: #9CA3AF;
    --border-color: rgba(139, 92, 246, 0.2);
    --bg-color: #1F2937;
    --bg-dark: #111827;
    --bg-card: rgba(31, 41, 55, 0.8);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, #1F2937 0%, #111827 50%, #1a1042 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 1rem;
    position: relative;
}

/* Container */
.container {
    max-width: 800px;
    margin: 2rem auto;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: var(--shadow-lg);
}

/* Logo oben zentriert */
.top-logo {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.top-logo .logo {
    height: 50px;
    width: auto;
    display: inline-block;
}

/* Header */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    position: relative;
}

.page-header h1 {
    font-size: 2.25rem;
    color: #FFFFFF;
    margin-bottom: 0.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.subheadline {
    font-size: 1.125rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Buchinfo - prominent */
.book-info {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(16, 185, 129, 0.15));
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2.5rem;
    text-align: center;
    border: 2px solid rgba(139, 92, 246, 0.4);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

.book-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}

.book-isbn {
    margin: 0.5rem 0 1.25rem 0;
    color: var(--text-light);
    font-size: 1rem;
}

.book-isbn strong {
    color: var(--text-color);
}

.book-video-link {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.75rem 1.75rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.book-video-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

/* Konditionen-Box */
.conditions-box {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2.5rem;
}

.conditions-box h2 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.conditions-list {
    list-style: none;
    margin-bottom: 1rem;
}

.conditions-list li {
    padding: 0.75rem 0;
    font-size: 1rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.conditions-list li::before {
    content: '✓';
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.conditions-list li strong {
    color: var(--text-color);
}

.conditions-note {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(16, 185, 129, 0.2);
    font-size: 0.95rem;
    color: var(--text-muted);
}

.conditions-note strong {
    color: var(--text-color);
}

/* Formular */
.order-form fieldset {
    border: none;
    padding: 0;
}

.order-form legend {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 2rem;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

.required {
    color: var(--error-color);
    font-weight: normal;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: rgba(17, 24, 39, 0.5);
    color: var(--text-color);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: rgba(17, 24, 39, 0.7);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-group input:invalid:not(:placeholder-shown),
.form-group input.error {
    border-color: var(--error-color);
}

.form-group input:valid:not(:placeholder-shown):not([type="number"]) {
    border-color: var(--success-color);
}

/* Adressgruppe */
.address-group {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    background: rgba(139, 92, 246, 0.05);
}

.address-group legend {
    font-size: 1.125rem;
    padding: 0 0.75rem;
    color: var(--text-light);
}

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

.form-group-small {
    flex: 0 0 30%;
}

.form-group-large {
    flex: 1;
}

/* Fehlermeldungen */
.error-message {
    display: block;
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    min-height: 1.25rem;
    font-weight: 500;
}

/* Preisvorschau */
.price-preview {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    padding: 2rem;
    margin: 2.5rem 0;
}

.price-preview h3 {
    font-size: 1.25rem;
    color: var(--primary-light);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.price-details {
    display: block;
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

.price-row:last-of-type {
    border-bottom: none;
}

.price-row dt {
    font-weight: 400;
    color: var(--text-muted);
}

.price-row dd {
    font-weight: 600;
    text-align: right;
    color: var(--text-color);
}

.price-total {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(139, 92, 246, 0.3);
    font-size: 1.25rem;
}

.price-total dt,
.price-total dd {
    color: var(--primary-light);
    font-weight: 700;
}

.price-note {
    margin-top: 1.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.25rem;
    background: rgba(139, 92, 246, 0.05);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-top: 0.25rem;
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
    flex: 1;
    color: var(--text-light);
    font-size: 0.95rem;
}

.checkbox-group a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.checkbox-group a:hover,
.checkbox-group a:focus {
    border-bottom-color: var(--primary-light);
}

/* Submit Button */
.form-actions {
    margin-top: 2.5rem;
    text-align: center;
}

.btn-submit {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    padding: 1.125rem 3.5rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-submit:hover:not(:disabled)::before {
    opacity: 1;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.btn-submit span {
    position: relative;
    z-index: 1;
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled {
    background: rgba(107, 70, 193, 0.3);
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
}

.btn-submit:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.4);
}

/* Success Message */
.success-message {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    margin-top: 2rem;
    box-shadow: var(--shadow-lg);
}

.success-message h2 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.75rem;
}

.success-message h2::before {
    content: '✓';
    display: inline-block;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--secondary-color);
    color: var(--bg-dark);
    border-radius: 50%;
    line-height: 2.5rem;
    font-weight: bold;
    font-size: 1.5rem;
}

.success-message p {
    color: var(--text-light);
    font-size: 1.05rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    color: var(--primary-light);
    font-size: 1.5rem;
    margin: 0;
}

.modal-close {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid var(--border-color);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-light);
    padding: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--primary-color);
}

.modal-close:focus {
    outline: 2px solid var(--primary-color);
}

.modal-body {
    padding: 2rem;
}

.modal-body .conditions-list {
    list-style: none;
    margin-left: 0;
}

.modal-body .conditions-list li {
    margin-bottom: 1rem;
    color: var(--text-light);
    padding-left: 1.75rem;
    position: relative;
}

.modal-body .conditions-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
}

.modal-body p {
    color: var(--text-light);
    margin-top: 1rem;
}

.modal-body p strong {
    color: var(--text-color);
}

.modal-footer {
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

.btn-secondary {
    background: rgba(139, 92, 246, 0.2);
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: var(--primary-color);
}

/* Honeypot */
.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }

    .top-logo .logo {
        height: 42px;
    }

    .container {
        padding: 2rem 1.5rem;
    }

    .book-title {
        font-size: 1.5rem;
    }

    .book-video-link {
        font-size: 0.95rem;
        padding: 0.65rem 1.5rem;
    }

    .page-header h1 {
        font-size: 1.75rem;
    }

    .subheadline {
        font-size: 1rem;
    }

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

    .form-group-small,
    .form-group-large {
        flex: 1;
        width: 100%;
    }

    .btn-submit {
        width: 100%;
        padding: 1rem;
    }

    .modal-content {
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .top-logo .logo {
        height: 38px;
    }

    .top-logo {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }

    .container {
        padding: 1.5rem 1rem;
    }

    .book-title {
        font-size: 1.35rem;
    }

    .book-info {
        padding: 1.5rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .conditions-box,
    .price-preview,
    .address-group {
        padding: 1.25rem;
    }

    .conditions-box h2,
    .price-preview h3 {
        font-size: 1.125rem;
    }
}

/* Focus-visible für bessere Tastaturnavigation */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-light: #000000;
    }

    .form-group input,
    .form-group select {
        border-width: 2px;
    }
}

/* Authentication Page */
.auth-container {
    max-width: 450px;
    margin: 3rem auto;
    padding: 0;
}

.auth-form {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

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

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    font-weight: 500;
    font-size: 1rem;
}

.auth-form input[type="text"] {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1.125rem;
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.auth-form input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(31, 41, 55, 0.9);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.auth-form .form-actions {
    margin-top: 2rem;
}

.auth-form .btn-submit {
    width: 100%;
    padding: 1rem;
    font-size: 1.125rem;
}

/* Thank You Page */
.thank-you-message {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.thank-you-message p {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.redirect-info {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 2rem;
}

.redirect-info a {
    color: var(--primary-color);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.redirect-info a:hover {
    color: var(--primary-light);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
