@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ── ACCESSIBILITY ────────────────────────────────────────────── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 10000;
    padding: 0.75rem 1.5rem;
    background: var(--ink);
    color: var(--white);
    border-radius: 0 0 8px 8px;
    text-decoration: none;
    font-weight: 600;
}
.skip-link:focus { top: 0; }
.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;
}

/* ── VARIABLEN ────────────────────────────────────────────────── */
:root {
    --white:        #FFFFFF;
    --bg:           #F5F5F7;
    --ink:          #1D1D1F;
    --ink-soft:     #6E6E73;
    --ink-muted:    #AEAEB2;
    --border:       rgba(0,0,0,0.08);
    --blue:         #0071E3;
    --blue-hover:   #0077ED;
    --blue-dark:    #0068D0;
    --font:         'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:    'IBM Plex Mono', monospace;
    --ease:         cubic-bezier(.25,.46,.45,.94);
    --ease-spring:  cubic-bezier(.34,1.56,.64,1);
    --max:          1200px;
    --pad:          2rem;
    --offset:       max(var(--pad), calc((100vw - var(--max)) / 2 + var(--pad)));
    --shadow-inset: inset 0 1px 2px rgba(0,0,0,0.1), inset 0 4px 8px rgba(0,0,0,0.05);
    --shadow-md:    0 8px 30px rgba(0,0,0,0.08);
    --overlay-dark: rgba(0,0,0,0.45);
    --backdrop-blur: saturate(180%) blur(20px);
}

/* ── RESET ───────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--white); }
body {
    font-family:            var(--font);
    background:             var(--white);
    color:                  var(--ink);
    -webkit-font-smoothing: antialiased;
    overflow-x:             hidden;
    min-height:             100dvh;
}
a { text-decoration: none; color: inherit; }
button, input, select, textarea { font-family: inherit; }
a, button, input, select, textarea, [onclick], [role="button"] {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.hidden { display: none; }

/* ── SCROLL LOCK (iOS-safe) ─────────────────────────────────── */
body.no-scroll {
    position: fixed;
    left: 0;
    right: 0;
    overflow: hidden;
    overscroll-behavior: none;
}

/* ── CUSTOM DIALOG ──────────────────────────────────────────── */
.dialog-backdrop {
    position:           fixed;
    inset:              0;
    z-index:            9998;
    background:         var(--overlay-dark);
    opacity:            0;
    transition:         opacity 0.25s ease;
}
.dialog-backdrop.visible { opacity: 1; }

.dialog-modal {
    position:           fixed;
    inset:              0;
    z-index:            9999;
    display:            flex;
    align-items:        center;
    justify-content:    center;
    padding:            1.5rem;
    pointer-events:     none;
}
.dialog-modal.hidden { display: none; }

.dialog-card {
    background:                 rgba(255,255,255,0.82);
    backdrop-filter:            var(--backdrop-blur);
    -webkit-backdrop-filter:    var(--backdrop-blur);
    border:                     1px solid var(--border);
    border-radius:              20px;
    box-shadow:                 0 24px 80px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.06);
    padding:                    2rem 2rem 1.5rem;
    max-width:                  360px;
    width:                      100%;
    text-align:                 center;
    pointer-events:             auto;
    opacity:                    0;
    transform:                  scale(0.92) translateY(10px);
    transition:                 opacity 0.3s ease, transform 0.35s cubic-bezier(.34,1.56,.64,1);
}
.dialog-modal.visible .dialog-card {
    opacity:   1;
    transform: scale(1) translateY(0);
}

.dialog-icon {
    width:              48px;
    height:             48px;
    margin:             0 auto 1rem;
    border-radius:      50%;
    display:            flex;
    align-items:        center;
    justify-content:    center;
    font-size:          1.3rem;
    font-weight:        700;
}
.dialog-icon-info {
    background: rgba(0,113,227,0.1);
    color:      var(--blue);
}
.dialog-icon-warn {
    background: rgba(255,59,48,0.1);
    color:      #FF3B30;
}
.dialog-icon-confirm {
    background: rgba(0,0,0,0.06);
    color:      var(--ink);
}
.dialog-icon:empty { display: none; }

.dialog-title {
    font-size:          1.05rem;
    font-weight:        650;
    letter-spacing:     -0.02em;
    color:              var(--ink);
    margin-bottom:      0.4rem;
}

.dialog-message {
    font-size:          0.85rem;
    font-weight:        400;
    color:              var(--ink-soft);
    line-height:        1.55;
    margin-bottom:      1.5rem;
}

.dialog-actions {
    display:            flex;
    gap:                0.5rem;
}

.dialog-btn {
    flex:               1;
    height:             42px;
    border:             none;
    border-radius:      12px;
    font-size:          0.85rem;
    font-weight:        600;
    cursor:             pointer;
    transition:         background 0.15s, transform 0.1s, opacity 0.15s;
    letter-spacing:     -0.01em;
}
.dialog-btn:active { transform: scale(0.97); }

.dialog-btn-primary {
    background:      var(--ink);
    color:           #fff;
}
.dialog-btn-primary:hover { background: #2d2d2f; }

.dialog-btn-danger {
    background:      #FF3B30;
    color:           #fff;
}
.dialog-btn-danger:hover { background: #E0342D; }

.dialog-btn-cancel {
    background:      rgba(0,0,0,0.05);
    color:           var(--ink);
}
.dialog-btn-cancel:hover { background: rgba(0,0,0,0.08); }

@media (max-width: 480px) {
    .dialog-card { padding: 1.5rem 1.2rem 1.2rem; border-radius: 16px; }
    .dialog-actions { flex-direction: column-reverse; }
}
