/* ============================================================
   Karriaro Mobile — iOS-Native App-Aesthetik (Sprint 89)

   Ziel: User soll das Gefuehl haben, in einer App fuer iPhone
   zu sein, nicht auf einer Mobile-Webseite. Im PWA-Standalone-
   Mode (Home-Screen-Icon) wirkt das ohne Browser-Chrome wie
   echte App.

   Patterns: Bottom-Tab-Bar, Sheet-Modals, Inset-Group-Lists,
   System-Font, Safe-Area-Insets, Spring-Animationen.
   Brand: Indigo als einziger Akzent, sonst iOS-System-Light.
   ============================================================ */

/* === Design-Tokens === */
:root {
    /* iOS-System-Light-Mode (UIKit-Reference-Werte) */
    --m-bg-grouped: #F2F2F7;             /* systemGroupedBackground */
    --m-bg-card: #FFFFFF;
    --m-bg-secondary: #E5E5EA;
    --m-separator: rgba(60, 60, 67, 0.12);
    --m-label-primary: #000000;
    --m-label-secondary: rgba(60, 60, 67, 0.60);
    --m-label-tertiary: rgba(60, 60, 67, 0.30);
    --m-tint: #1A2E40;                   /* Karriaro-Indigo als Akzent */
    --m-tint-strong: #061320;
    --m-gold: #8A7B5C;                   /* Premium-Akzent (sparsam) */

    /* Tab-Bar */
    --m-tab-bar-height: 56px;
    --m-tab-bar-bg: rgba(255, 255, 255, 0.82);

    /* Safe-Area */
    --m-safe-top: env(safe-area-inset-top, 0);
    --m-safe-bottom: env(safe-area-inset-bottom, 0);

    /* Fonts: System-First, Fraunces nur fuer Brand-Anchor */
    --m-font-sys: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
                  "Inter", "Helvetica Neue", system-ui, sans-serif;
    --m-font-brand: "Fraunces", Georgia, serif;
    --m-font-mono: "SF Mono", "JetBrains Mono", Menlo, monospace;

    /* Spring-Easing */
    --m-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --m-ease: cubic-bezier(0.4, 0.0, 0.2, 1);

    /* Radii (iOS-typisch) */
    --m-r-card: 14px;
    --m-r-sheet: 14px;
    --m-r-pill: 999px;
}

/* === Reset === */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { overflow-x: hidden; max-width: 100vw; height: 100%; }
html { font-size: 17px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--m-font-sys);
    background: var(--m-bg-grouped);
    color: var(--m-label-primary);
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    padding-bottom: calc(var(--m-tab-bar-height) + var(--m-safe-bottom) + 8px);
}
img, video, iframe, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--m-tint); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
ul, ol { list-style: none; }

/* === Skip-Link (echt versteckt) === */
.m-skip {
    position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.m-skip:focus {
    position: fixed; top: 12px; left: 12px; width: auto; height: auto;
    background: var(--m-tint); color: #fff;
    padding: 12px 18px; border-radius: 10px; z-index: 9999;
}

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

/* === Top-Navigation (iOS-style, klein + transluzent) === */
.m-topnav {
    position: sticky; top: 0; z-index: 60;
    background: rgba(242, 242, 247, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    padding-top: var(--m-safe-top);
    border-bottom: 0.5px solid var(--m-separator);
}
.m-topnav-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 44px;
    padding: 0 16px;
}
.m-topnav-title {
    font-family: var(--m-font-sys);
    font-size: 17px;
    font-weight: 600;
    color: var(--m-label-primary);
    letter-spacing: -0.022em;
}
.m-topnav-brand {
    font-family: var(--m-font-brand);
    font-size: 22px;
    font-weight: 500;
    color: var(--m-label-primary);
    letter-spacing: -0.015em;
    font-variation-settings: "opsz" 72;
}
.m-topnav-action {
    min-width: 44px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--m-tint);
    font-size: 17px;
    font-weight: 400;
    padding: 0 8px;
}

/* === Container & Sections === */
.m-page { padding: 16px 0 24px; }
.m-section { padding: 0 0 32px; }
.m-section-title {
    font-family: var(--m-font-sys);
    font-size: 13px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--m-label-secondary);
    padding: 0 32px 6px;
    margin-top: 24px;
}
.m-section-footer {
    font-size: 13px;
    color: var(--m-label-secondary);
    padding: 6px 32px 0;
    line-height: 1.4;
}

/* === Hero-Card (Top-of-Page Big-Statement) === */
.m-hero-card {
    background: linear-gradient(160deg, #1A2E40 0%, #061320 100%);
    color: #fff;
    margin: 0 16px 24px;
    padding: 32px 24px 28px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}
.m-hero-card::before {
    content: "";
    position: absolute; right: -40px; top: -40px;
    width: 180px; height: 180px;
    background: radial-gradient(circle, rgba(201, 182, 139, 0.18) 0%, transparent 70%);
    pointer-events: none;
}
.m-hero-brand {
    font-family: var(--m-font-brand);
    font-size: 32px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-bottom: 8px;
    font-variation-settings: "opsz" 144;
}
.m-hero-brand em {
    font-style: italic;
    color: #C9B68B;
    font-weight: 500;
}
.m-hero-sub {
    font-size: 15px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 20px;
}
.m-hero-cta {
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; color: var(--m-tint-strong);
    font-size: 16px; font-weight: 600;
    padding: 12px 22px;
    border-radius: var(--m-r-pill);
    min-height: 44px;
}
.m-hero-cta:active { transform: scale(0.97); transition: transform 80ms; }

/* === Inset-Group-List (iOS Settings-Style) === */
.m-list {
    background: var(--m-bg-card);
    margin: 0 16px;
    border-radius: var(--m-r-card);
    overflow: hidden;
}
.m-list-row {
    display: flex; align-items: center;
    gap: 14px;
    padding: 14px 16px;
    min-height: 56px;
    border-top: 0.5px solid var(--m-separator);
    color: var(--m-label-primary);
    font-size: 17px;
    transition: background-color 100ms;
}
.m-list-row:first-child { border-top: 0; }
.m-list-row:active { background-color: var(--m-bg-secondary); }
.m-list-row-icon {
    width: 30px; height: 30px;
    border-radius: 7px;
    background: var(--m-tint);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.m-list-row-icon svg { width: 18px; height: 18px; }
.m-list-row-icon--gold { background: var(--m-gold); }
.m-list-row-text { flex: 1; min-width: 0; }
.m-list-row-title {
    font-weight: 400;
    line-height: 1.3;
    color: var(--m-label-primary);
}
.m-list-row-sub {
    font-size: 13px;
    color: var(--m-label-secondary);
    margin-top: 2px;
    line-height: 1.3;
}
.m-list-row-trail {
    font-size: 15px;
    color: var(--m-label-secondary);
    flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 4px;
}
.m-list-row-trail::after {
    content: "";
    width: 8px; height: 14px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 14" fill="none" stroke="rgba(60,60,67,0.30)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="1,1 7,7 1,13"/></svg>') no-repeat center;
}
.m-list-row-trail--price {
    color: var(--m-label-primary);
    font-weight: 500;
}

/* === Hero-Snapshot-Card (Premium-Showcase ohne Browser-Mockup) === */
.m-snapshot {
    background: var(--m-bg-card);
    margin: 24px 16px;
    border-radius: var(--m-r-card);
    overflow: hidden;
}
.m-snapshot-img {
    width: 100%; aspect-ratio: 4/3;
    object-fit: cover; object-position: center;
}
.m-snapshot-body { padding: 16px 18px 18px; }
.m-snapshot-eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--m-gold);
    font-weight: 600;
    margin-bottom: 6px;
}
.m-snapshot-title {
    font-family: var(--m-font-sys);
    font-size: 19px;
    font-weight: 600;
    color: var(--m-label-primary);
    line-height: 1.25;
    margin-bottom: 4px;
}
.m-snapshot-sub {
    font-size: 14px;
    color: var(--m-label-secondary);
    line-height: 1.4;
}

/* === Bottom-Tab-Bar === */
.m-tabbar {
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 90;
    background: var(--m-tab-bar-bg);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border-top: 0.5px solid var(--m-separator);
    padding-bottom: var(--m-safe-bottom);
    display: flex;
}
.m-tabbar-item {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 2px;
    height: var(--m-tab-bar-height);
    color: var(--m-label-secondary);
    font-size: 10px;
    font-weight: 500;
    transition: color 120ms;
    -webkit-tap-highlight-color: transparent;
}
.m-tabbar-item svg { width: 24px; height: 24px; }
.m-tabbar-item.is-active { color: var(--m-tint); }
.m-tabbar-item:active { opacity: 0.6; }

/* === Sheet-Modal (Slide-Up von unten, iOS-Style) === */
.m-sheet-backdrop {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
    z-index: 200;
    transition: background-color 240ms;
}
.m-sheet-backdrop.is-open {
    background: rgba(0, 0, 0, 0.4);
    pointer-events: auto;
}
.m-sheet {
    position: fixed; left: 0; right: 0; bottom: 0;
    background: var(--m-bg-grouped);
    border-radius: 14px 14px 0 0;
    transform: translateY(100%);
    transition: transform 320ms var(--m-spring);
    z-index: 210;
    max-height: 88vh;
    overflow-y: auto;
    padding-bottom: var(--m-safe-bottom);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
}
.m-sheet.is-open { transform: translateY(0); }
.m-sheet-handle {
    width: 36px; height: 5px;
    background: rgba(60, 60, 67, 0.25);
    border-radius: 3px;
    margin: 8px auto 0;
}
.m-sheet-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px 12px;
}
.m-sheet-title {
    font-size: 17px; font-weight: 600;
    color: var(--m-label-primary);
}
.m-sheet-close {
    color: var(--m-tint);
    font-size: 17px;
    font-weight: 400;
    min-height: 44px;
    padding: 0 8px;
}
.m-sheet-body { padding: 0 0 24px; }

/* === Form-Inputs (iOS-Native-Style) === */
.m-input {
    width: 100%;
    background: var(--m-bg-card);
    border: 0;
    border-radius: 12px;
    padding: 14px 16px;
    font-family: var(--m-font-sys);
    font-size: 17px;
    color: var(--m-label-primary);
    min-height: 50px;
    -webkit-appearance: none; appearance: none;
}
.m-input:focus {
    outline: 2px solid var(--m-tint);
    outline-offset: -2px;
}
.m-form-group {
    margin: 0 16px 16px;
    display: flex; flex-direction: column;
    gap: 1px;
    background: var(--m-bg-card);
    border-radius: 12px;
    overflow: hidden;
}
.m-form-group .m-input {
    border-radius: 0;
}
.m-form-group .m-input + .m-input {
    border-top: 0.5px solid var(--m-separator);
}
.m-form-cta {
    display: flex; align-items: center; justify-content: center;
    background: var(--m-tint);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    border-radius: 12px;
    min-height: 50px;
    margin: 8px 16px 0;
    -webkit-tap-highlight-color: transparent;
}
.m-form-cta:active { background: var(--m-tint-strong); }

/* === Premium-Badge (Gold, sparsam) === */
.m-badge-premium {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(138, 123, 92, 0.12);
    color: var(--m-gold);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
}

/* === Footer (klein, am Ende der Page) === */
.m-footer {
    text-align: center;
    padding: 24px 32px 16px;
    color: var(--m-label-tertiary);
    font-size: 12px;
    line-height: 1.5;
}
.m-footer a { color: var(--m-label-secondary); margin: 0 6px; }
.m-footer-meta { font-size: 11px; margin-top: 8px; }
