/**
 * OYROPA UNIFIED MOBILE-FIRST LAYOUT SYSTEM
 *
 * Einheitliches, touch-freundliches Layout für alle Seiten
 * Mobile-First mit Progressive Enhancement
 * WCAG AA konform mit 44px Touch-Targets
 */

/* ========================================
   MOBILE-FIRST RESET & BASE
   ======================================== */

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

html {
    font-size: 16px; /* iOS-Zoom-Prevention */
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px; /* iOS-Zoom-Prevention für Inputs */
    line-height: 1.6;
    color: #1e293b;
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Verhindert horizontales Scrollen */
    overflow-x: hidden;
    width: 100%;
}

/* ========================================
   RESPONSIVE CONTAINER SYSTEM
   ======================================== */

.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1rem; /* 16px Mobile */
}

/* Tablet: 768px+ */
@media (min-width: 768px) {
    .container {
        max-width: 768px;
        padding: 0 2rem; /* 32px Tablet */
    }
}

/* Desktop: 1024px+ */
@media (min-width: 1024px) {
    .container {
        max-width: 1200px;
        padding: 0 3rem; /* 48px Desktop */
    }
}

/* ========================================
   MOBILE-FIRST HEADER SYSTEM
   ======================================== */

.header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.header-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    min-height: 80px;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2F6BB3;
    text-decoration: none;
    /* Logo-Größe für Mobile optimiert */
    min-height: 44px;
}

.logo svg,
.logo img {
    width: 40px;
    height: 40px;
}

/* Mobile Navigation (Hamburger) */
.nav-desktop {
    display: none;
}

.nav-mobile {
    display: block;
}

.mobile-menu-toggle {
    min-width: 44px;
    min-height: 44px;
    border: none;
    background: transparent;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: background-color 0.15s ease;
}

.mobile-menu-toggle:hover {
    background-color: #f1f5f9;
}

.mobile-menu-toggle:focus {
    outline: 2px solid #2F6BB3;
    outline-offset: 2px;
}

/* Mobile Menu Overlay */
.mobile-menu {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    z-index: 999;
    padding: 2rem;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.mobile-menu.open {
    transform: translateX(0);
}

.mobile-menu .nav-link {
    display: block;
    padding: 1rem 0;
    min-height: 44px;
    color: #475569;
    text-decoration: none;
    border-bottom: 1px solid #e2e8f0;
    font-size: 1.125rem;
}

.mobile-menu .nav-link:hover,
.mobile-menu .nav-link:focus {
    color: #2F6BB3;
    background-color: #f1f5f9;
}

/* Tablet+ Navigation */
@media (min-width: 768px) {
    .nav-mobile {
        display: none;
    }

    .nav-desktop {
        display: flex;
        align-items: center;
        gap: 2rem;
    }

    .nav-desktop .nav-link {
        padding: 0.75rem 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        color: #475569;
        text-decoration: none;
        border-radius: 0.5rem;
        transition: all 0.15s ease;
    }

    .nav-desktop .nav-link:hover,
    .nav-desktop .nav-link:focus {
        background-color: #f1f5f9;
        color: #2F6BB3;
    }

    .nav-desktop .nav-link:focus {
        outline: 2px solid #2F6BB3;
        outline-offset: 2px;
    }
}

/* ========================================
   MOBILE-FIRST BUTTON SYSTEM
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    min-height: 44px; /* WCAG AA Touch-Target */
    min-width: 44px;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 16px; /* iOS-Zoom-Prevention */
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    text-align: center;
    white-space: nowrap;
}

.btn:focus {
    outline: 2px solid #2F6BB3;
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Button Variants */
.btn--primary {
    background-color: #2F6BB3;
    border-color: #2F6BB3;
    color: #ffffff;
}

.btn--primary:hover {
    background-color: #255896;
    border-color: #255896;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn--secondary {
    background-color: #ffffff;
    border-color: #e2e8f0;
    color: #475569;
}

.btn--secondary:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.btn--accent {
    background-color: #C74B4B;
    border-color: #C74B4B;
    color: #ffffff;
}

.btn--accent:hover {
    background-color: #B91C1C;
    border-color: #B91C1C;
}

.btn--ghost {
    background-color: transparent;
    border-color: #2F6BB3;
    color: #2F6BB3;
}

.btn--ghost:hover {
    background-color: #f1f5f9;
}

/* Button Sizes */
.btn--sm {
    padding: 0.5rem 1rem;
    min-height: 36px;
    font-size: 14px;
}

.btn--lg {
    padding: 1.25rem 2rem;
    min-height: 52px;
    font-size: 18px;
}

.btn--full {
    width: 100%;
}

/* ========================================
   MOBILE-FIRST FORM SYSTEM
   ======================================== */

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 16px;
    font-weight: 500;
    color: #374151;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    min-height: 44px; /* Touch-Target für Mobile */
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 16px; /* Verhindert iOS-Zoom */
    background-color: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #2F6BB3;
    box-shadow: 0 0 0 3px rgba(47, 107, 179, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-error {
    margin-top: 0.5rem;
    font-size: 14px;
    color: #ef4444;
}

/* ========================================
   MOBILE-FIRST CARD SYSTEM
   ======================================== */

.card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
    margin-bottom: 1rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.card__header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.card__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.card__subtitle {
    font-size: 0.875rem;
    color: #64748b;
}

.card__body {
    margin-bottom: 1rem;
}

.card__footer {
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

/* ========================================
   MOBILE-FIRST GRID SYSTEM
   ======================================== */

.grid {
    display: grid;
    gap: 1rem;
    width: 100%;
}

/* Mobile: 1 Column */
.grid--cols-1 { grid-template-columns: 1fr; }
.grid--cols-2 { grid-template-columns: 1fr; }
.grid--cols-3 { grid-template-columns: 1fr; }
.grid--cols-4 { grid-template-columns: 1fr; }

/* Tablet: 768px+ */
@media (min-width: 768px) {
    .grid {
        gap: 1.5rem;
    }

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

/* Desktop: 1024px+ */
@media (min-width: 1024px) {
    .grid {
        gap: 2rem;
    }

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

/* ========================================
   MOBILE-FIRST SECTION SPACING
   ======================================== */

.section {
    padding: 2rem 0;
    width: 100%;
}

@media (min-width: 768px) {
    .section {
        padding: 3rem 0;
    }
}

@media (min-width: 1024px) {
    .section {
        padding: 4rem 0;
    }
}

/* ========================================
   MOBILE-FIRST TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: #1e293b;
    margin-bottom: 1rem;
}

/* Mobile-First Responsive Headings */
h1 { font-size: clamp(1.75rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.875rem); }
h4 { font-size: clamp(1.125rem, 2.5vw, 1.5rem); }
h5 { font-size: clamp(1rem, 2vw, 1.25rem); }
h6 { font-size: clamp(0.875rem, 1.5vw, 1.125rem); }

p, ul, ol {
    margin-bottom: 1rem;
    max-width: 65ch; /* Optimale Lesbarkeit auf Mobile */
}

@media (min-width: 768px) {
    p, ul, ol {
        max-width: 75ch;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Spacing */
.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }
.mt-xl { margin-top: 2rem; }

.mb-sm { margin-bottom: 0.5rem; }
.mb-md { margin-bottom: 1rem; }
.mb-lg { margin-bottom: 1.5rem; }
.mb-xl { margin-bottom: 2rem; }

.p-sm { padding: 0.5rem; }
.p-md { padding: 1rem; }
.p-lg { padding: 1.5rem; }
.p-xl { padding: 2rem; }

/* Text Alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Display */
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none; }

/* Responsive Visibility */
.mobile-only { display: block; }
.tablet-up { display: none; }
.desktop-up { display: none; }

@media (min-width: 768px) {
    .mobile-only { display: none; }
    .tablet-up { display: block; }
}

@media (min-width: 1024px) {
    .desktop-up { display: block; }
    .tablet-only { display: none; }
}

/* Width Utilities */
.w-full { width: 100%; }
.w-auto { width: auto; }
.max-w-none { max-width: none; }

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */

/* Focus Management */
.btn:focus-visible,
.nav-link:focus-visible,
.form-input:focus-visible {
    outline: 2px solid #2F6BB3;
    outline-offset: 2px;
}

/* Skip Links */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #2F6BB3;
    color: #ffffff;
    padding: 8px;
    text-decoration: none;
    border-radius: 0.25rem;
    z-index: 1001;
}

.skip-link:focus {
    top: 6px;
}

/* 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: 0;
}

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

/* High Contrast Support */
@media (prefers-contrast: high) {
    .btn {
        border-width: 3px;
    }

    .form-input:focus,
    .form-select:focus,
    .form-textarea:focus {
        border-width: 3px;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .nav-mobile,
    .nav-desktop,
    .btn,
    .mobile-menu {
        display: none;
    }

    .container {
        max-width: none;
        padding: 0;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }
}