/* ========================================
   CSS Reset & Base Styles
   ENTERPRISE-GRADE MOBILE-FIRST
   ======================================== */

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

:root {
    /* Farbschema A - Klassisch Oster */
    --primary-color: #A8D5BA;        /* Pastellgrün */
    --accent-color: #FFE5A0;         /* Pastellgelb */
    --button-color: #FF9F40;         /* Orange */
    --button-hover: #FF8520;         /* Dunkleres Orange */
    --text-dark: #2C3E50;            /* Dunkelgrau */
    --text-light: #5A6C7D;           /* Mittelgrau */
    --background: #FFFFFF;           /* Weiß */
    --background-light: #F8F9FA;     /* Helles Grau */
    --border-color: #E1E8ED;         /* Border */
    --success-color: #27AE60;        /* Grün */
    --error-color: #E74C3C;          /* Rot */

    /* Spacing - Mobile First */
    --spacing-xs: 0.5rem;            /* 8px */
    --spacing-sm: 1rem;              /* 16px */
    --spacing-md: 1.5rem;            /* 24px */
    --spacing-lg: 2rem;              /* 32px */
    --spacing-xl: 2.5rem;            /* 40px */
    --spacing-xxl: 3rem;             /* 48px */

    /* Touch-Target Sizes (iOS: 44px, Android: 48px) */
    --touch-target-min: 48px;

    /* Safe Area Insets (for iPhone notch, etc.) */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);

    /* Fonts */
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-heading: Georgia, "Times New Roman", serif;
}

/* Prevent horizontal scrolling on mobile */
html {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%; /* Prevent iOS auto-zoom */
}

body {
    font-family: var(--font-primary);
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--background);
    overflow-x: hidden;
    /* Prevent tap delay on mobile */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    /* Safe area padding */
    padding-left: var(--safe-area-left);
    padding-right: var(--safe-area-right);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ========================================
   Header
   ======================================== */

header {
    background-color: var(--background);
    border-bottom: 2px solid var(--primary-color);
    padding: var(--spacing-md) 0;
    /* Safe area top padding */
    padding-top: calc(var(--spacing-md) + var(--safe-area-top));
}

.header-brand {
    text-align: center;
}

.header-brand h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.25rem, 5vw, 1.75rem);
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.2;
}

.header-subtitle {
    font-size: clamp(0.8rem, 2.5vw, 0.9375rem);
    color: var(--text-light);
    margin: 0;
    margin-top: var(--spacing-xs);
}

/* ========================================
   Hero Section - MOBILE OPTIMIZED
   ======================================== */

.hero {
    padding: var(--spacing-xl) 0;
    background: linear-gradient(135deg, var(--background) 0%, var(--background-light) 100%);
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    align-items: center;
}

@media (min-width: 768px) {
    .hero {
        padding: var(--spacing-xxl) 0;
    }

    .hero-content {
        display: grid;
        grid-template-columns: 1fr 1.2fr;
        gap: var(--spacing-xxl);
    }
}

.hero-image {
    text-align: center;
    width: 100%;
}

.book-cover {
    max-width: 100%;
    width: min(80vw, 400px);
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s ease;
    /* Prevent layout shift */
    aspect-ratio: 2 / 3;
}

@media (min-width: 768px) {
    .book-cover {
        max-height: 500px;
        width: auto;
    }
}

.book-cover:hover {
    transform: scale(1.05);
}

.hero-text {
    text-align: center;
}

@media (min-width: 768px) {
    .hero-text {
        text-align: left;
    }
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 6vw, 2.5rem);
    line-height: 1.2;
    color: var(--text-dark);
    margin-bottom: var(--spacing-md);
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.125rem);
    color: var(--text-light);
    margin-bottom: var(--spacing-lg);
    line-height: 1.7;
}

.benefits {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    /* Mobile: zentrieren */
    align-items: center;
}

@media (min-width: 768px) {
    .benefits {
        align-items: stretch;
    }
}

.benefit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--accent-color);
    border-radius: 8px;
    font-weight: 500;
    font-size: clamp(0.9375rem, 2.5vw, 1rem);
    /* Touch-friendly padding */
    min-height: 44px;
    /* Mobile: volle Breite */
    width: 100%;
}

@media (min-width: 768px) {
    .benefit {
        justify-content: flex-start;
    }
}

.benefit-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* ========================================
   Form Section - MOBILE OPTIMIZED
   ======================================== */

.form-section {
    padding: var(--spacing-xxl) 0;
    background-color: var(--background);
    /* Safe area bottom padding */
    padding-bottom: calc(var(--spacing-xxl) + var(--safe-area-bottom));
}

.form-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--background-light);
    padding: var(--spacing-lg);
    border-radius: 16px;
    border: 2px solid var(--primary-color);
}

@media (min-width: 768px) {
    .form-container {
        padding: var(--spacing-xxl);
    }
}

.form-title {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 5vw, 2rem);
    text-align: center;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

.form-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: var(--spacing-lg);
    font-size: clamp(0.9375rem, 2.5vw, 1.0625rem);
}

.download-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

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

.form-group label {
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-dark);
    font-size: clamp(0.9375rem, 2.5vw, 1rem);
}

/* INPUT FIELDS - MOBILE OPTIMIZED */
.form-group input[type="email"] {
    /* Min 44px height for touch targets */
    min-height: var(--touch-target-min);
    padding: var(--spacing-md);
    /* Min 16px font to prevent iOS auto-zoom */
    font-size: max(16px, 1rem);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: var(--font-primary);
    /* Better touch experience */
    -webkit-appearance: none;
    appearance: none;
}

.form-group input[type="email"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(168, 213, 186, 0.2);
}

/* CHECKBOX - ENTERPRISE GRADE TOUCH TARGET */
.checkbox-group {
    flex-direction: column;
    gap: 0;
}

.checkbox-wrapper {
    position: relative;
    display: block;
}

/* Hide native checkbox */
.checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    cursor: pointer;
    /* Larger touch target */
    padding: var(--spacing-sm);
    margin: calc(var(--spacing-sm) * -1);
    /* Min touch target height */
    min-height: var(--touch-target-min);
}

/* Custom checkbox - 44x44px touch target */
.checkbox-custom {
    position: relative;
    display: block;
    width: 24px;
    height: 24px;
    min-width: 24px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
    transition: all 0.2s ease;
    /* Center in 44px touch area */
    margin-top: 2px;
}

/* Expand touch area without affecting layout */
.checkbox-custom::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--touch-target-min);
    height: var(--touch-target-min);
}

/* Checkbox checked state */
input[type="checkbox"]:checked + .checkbox-label .checkbox-custom {
    background-color: var(--button-color);
    border-color: var(--button-color);
}

/* Checkmark */
input[type="checkbox"]:checked + .checkbox-label .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    font-weight: bold;
}

/* Focus state for accessibility */
input[type="checkbox"]:focus + .checkbox-label .checkbox-custom {
    box-shadow: 0 0 0 3px rgba(168, 213, 186, 0.3);
}

.checkbox-text {
    font-size: clamp(0.875rem, 2.2vw, 0.9375rem);
    line-height: 1.6;
    color: var(--text-light);
    font-weight: 400;
    flex: 1;
}

.checkbox-text a {
    color: var(--text-dark);
    text-decoration: underline;
    /* Larger touch target for links */
    display: inline-block;
    padding: 4px 2px;
}

.checkbox-text a:hover {
    color: var(--button-color);
}

/* SUBMIT BUTTON - MOBILE OPTIMIZED */
.submit-btn {
    background-color: var(--button-color);
    color: white;
    /* Min 48px height for touch */
    min-height: var(--touch-target-min);
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: clamp(1rem, 3vw, 1.125rem);
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: var(--spacing-sm);
    /* Better touch experience */
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    width: 100%;
}

@media (min-width: 768px) {
    .submit-btn {
        width: auto;
    }
}

.submit-btn:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
}

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

.submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.submit-btn:hover .btn-icon {
    transform: translateX(4px);
}

/* Form Note */
.form-note {
    text-align: center;
    font-size: clamp(0.8125rem, 2vw, 0.875rem);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.form-note .icon {
    font-size: 1rem;
}

/* ========================================
   Success & Error Messages
   ======================================== */

.success-message,
.error-message {
    text-align: center;
    padding: var(--spacing-lg);
    border-radius: 12px;
    animation: fadeIn 0.4s ease;
}

@media (min-width: 768px) {
    .success-message,
    .error-message {
        padding: var(--spacing-xl);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-message {
    background-color: #d4edda;
    border: 2px solid var(--success-color);
}

.error-message {
    background-color: #f8d7da;
    border: 2px solid var(--error-color);
}

.success-icon,
.error-icon {
    font-size: clamp(2.5rem, 8vw, 3rem);
    margin-bottom: var(--spacing-sm);
    font-weight: bold;
}

.success-icon {
    color: var(--success-color);
}

.error-icon {
    color: var(--error-color);
}

.success-message h3,
.error-message h3 {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    margin-bottom: var(--spacing-sm);
}

.success-message p,
.error-message p {
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
    font-size: clamp(0.9375rem, 2.5vw, 1rem);
}

.success-message p:last-child,
.error-message p:last-child {
    margin-bottom: 0;
}

.success-note {
    font-size: clamp(0.875rem, 2.2vw, 0.9375rem);
    color: var(--text-light);
}

.error-message a {
    color: var(--error-color);
    text-decoration: underline;
    /* Larger touch target */
    padding: 4px;
}

/* ========================================
   Trust Section
   ======================================== */

.trust-section {
    padding: var(--spacing-xxl) 0;
    background-color: var(--background-light);
}

.trust-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.trust-content h3 {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4.5vw, 1.75rem);
    margin-bottom: var(--spacing-md);
    color: var(--text-dark);
}

.trust-content p {
    font-size: clamp(0.9375rem, 2.5vw, 1.0625rem);
    color: var(--text-light);
    line-height: 1.8;
}

/* ========================================
   Review Section
   ======================================== */

.review-section {
    padding: var(--spacing-xxl) 0;
    background-color: var(--accent-color);
}

.review-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.review-content h3 {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4.5vw, 1.75rem);
    margin-bottom: var(--spacing-md);
    color: var(--text-dark);
}

.review-content p {
    font-size: clamp(0.9375rem, 2.5vw, 1.0625rem);
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: var(--spacing-lg);
}

.review-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    background-color: #FF9900;
    color: white;
    min-height: var(--touch-target-min);
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: clamp(1rem, 3vw, 1.125rem);
    font-weight: 700;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    touch-action: manipulation;
    /* Mobile: volle Breite */
    width: 100%;
}

@media (min-width: 768px) {
    .review-btn {
        width: auto;
    }
}

.review-btn:hover {
    background-color: #E68A00;
    transform: translateY(-2px);
}

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

/* ========================================
   Footer
   ======================================== */

footer {
    background-color: var(--text-dark);
    color: white;
    padding: var(--spacing-lg) 0;
    /* Safe area bottom padding */
    padding-bottom: calc(var(--spacing-lg) + var(--safe-area-bottom));
}

.footer-content {
    text-align: center;
}

.footer-links {
    margin-bottom: var(--spacing-sm);
}

.footer-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
    /* Larger touch target */
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    min-height: 44px;
    line-height: 1.5;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.separator {
    margin: 0 var(--spacing-xs);
}

.footer-copy {
    font-size: clamp(0.8125rem, 2vw, 0.875rem);
    color: rgba(255, 255, 255, 0.7);
}

.footer-sponsor {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-sponsor p {
    font-size: clamp(0.875rem, 2vw, 1rem);
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 var(--spacing-md) 0;
}

.footer-sponsor a {
    display: inline-block;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.footer-sponsor a:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

.sponsor-logo {
    max-width: 200px;
    width: 100%;
    height: auto;
}

@media (min-width: 768px) {
    .sponsor-logo {
        max-width: 250px;
    }
}

/* ========================================
   Performance & Accessibility
   ======================================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .submit-btn {
        border: 2px solid currentColor;
    }

    .checkbox-custom {
        border-width: 3px;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Keep light theme for now, but prepared for dark mode */
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 3px solid var(--button-color);
    outline-offset: 2px;
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .submit-btn,
    .form-note,
    footer {
        display: none;
    }
}
