@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/hanken-grotesk-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/hanken-grotesk-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ===================================================================
   DropicIsland — tropical glass theme
   =================================================================== */
:root {
    --font-display: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-ui: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --accent: #0b7a73;
    --accent-strong: #08605a;
    --accent-ink: #ffffff;
    --accent-2: #0b7a73;
    --accent-3: #0b7a73;
    --focus-ring: rgba(11, 122, 115, 0.22);

    --text-primary: #0b2a33;
    --text-secondary: #3d5c64;
    --text-muted: #6b868d;
    --hero-ink: #0b2a33;
    --bg-primary: #ffffff;
    --bg-secondary: #eef5f4;
    --border-color: rgba(11, 42, 51, 0.1);
    --border-strong: rgba(11, 42, 51, 0.2);
    --shadow-color: rgba(8, 34, 42, 0.16);

    --surface: rgba(255, 255, 255, 0.9);
    --surface-solid: #ffffff;
    --surface-border: rgba(255, 255, 255, 0.7);
    --field-bg: #ffffff;
    --error-text: #c0392b;
    --drop-bg: rgba(255, 255, 255, 0.1);
    --drop-border: rgba(11, 42, 51, 0.28);
    --scroll-thumb: rgba(11, 42, 51, 0.28);

    /* Frosted glass surfaces */
    --glass-bg: rgba(255, 255, 255, 0.74);
    --glass-strong: rgba(255, 255, 255, 0.9);
    --glass-blur: saturate(160%) blur(26px);
    --glass-border: rgba(255, 255, 255, 0.55);

    /* legacy aliases (used across components) */
    --overlay-bg: var(--glass-bg);
    --bg-image: url('/images/back-day.jpg');

    /* tropical button variables */
    --btn-gradient-start: #0b7a73;
    --btn-gradient-end: #0b7a73;
    --btn-text-color: #ffffff;
    --btn-radius: 12px;
    --btn-shadow: 0 12px 28px rgba(6, 128, 132, 0.28);
    --btn-hover-shadow: 0 18px 40px rgba(6, 128, 132, 0.34);
    --btn-border: rgba(255, 255, 255, 0.4);
}

:root.dark-mode {
    --accent: #5fd6c8;
    --accent-strong: #84e3d8;
    --accent-ink: #052421;
    --accent-2: #5fd6c8;
    --accent-3: #5fd6c8;
    --focus-ring: rgba(95, 214, 200, 0.25);

    --text-primary: #e8f3f1;
    --text-secondary: #a9c3c4;
    --text-muted: #7d9a9e;
    --hero-ink: #f2faf9;
    --bg-primary: #0e2129;
    --bg-secondary: #15303a;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
    --shadow-color: rgba(0, 0, 0, 0.5);

    --surface: rgba(10, 27, 34, 0.88);
    --surface-solid: #0e2129;
    --surface-border: rgba(255, 255, 255, 0.08);
    --field-bg: #12272f;
    --error-text: #ff8a7a;
    --drop-bg: rgba(255, 255, 255, 0.03);
    --drop-border: rgba(255, 255, 255, 0.28);
    --scroll-thumb: rgba(255, 255, 255, 0.28);

    --glass-bg: rgba(12, 28, 35, 0.66);
    --glass-strong: rgba(12, 28, 35, 0.82);
    --glass-blur: saturate(150%) blur(26px);
    --glass-border: rgba(255, 255, 255, 0.12);

    --overlay-bg: var(--glass-bg);
    --bg-image: url('/images/back-night.jpg');

    --btn-gradient-start: #5fd6c8;
    --btn-gradient-end: #5fd6c8;
    --btn-text-color: #052421;
    --btn-shadow: 0 12px 30px rgba(0, 0, 0, 0.42);
    --btn-hover-shadow: 0 18px 44px rgba(0, 0, 0, 0.48);
}

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    font-family: var(--font-ui);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
/* Fallback canvas behind the fixed photo layers. Body MUST stay transparent,
   otherwise its background paints over the negative z-index background layers. */
html { background: #0e2a31; }
body { background: transparent; }

/* ---- Fullscreen background with smooth day -> night cross-fade ---- */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    background: url('/images/back-day.jpg') center center / cover no-repeat;
}
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background: url('/images/back-night.jpg') center center / cover no-repeat;
    opacity: 0;
    transition: opacity 0.9s ease;
}
html.dark-mode body::after { opacity: 1; }

/* Legibility scrim over the photo, under the UI (top + bottom vignette). */
.bg-scrim {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 340px 110px at 150px 44px, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.35) 55%, transparent 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.62) 0, rgba(255, 255, 255, 0.4) 64px, rgba(255, 255, 255, 0.12) 160px, transparent 38%);
    transition: background 0.9s ease;
}
html.dark-mode .bg-scrim {
    background:
        radial-gradient(ellipse 340px 110px at 150px 44px, rgba(0, 8, 12, 0.5), transparent 100%),
        linear-gradient(180deg, rgba(0, 8, 12, 0.35) 0%, transparent 34%);
}

::selection { background: var(--focus-ring); }

* {
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;
}

/* ---- Theme icon toggling via CSS (prevents flicker) ---- */
.icon-sun,
.icon-moon {
    width: 18px;
    height: 18px;
    display: none;
    background: currentColor;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
}
.icon-moon {
    display: block;
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21 14.5A8.5 8.5 0 0 1 9.5 3 8.5 8.5 0 1 0 21 14.5Z' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.icon-sun {
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='4' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32 1.41 1.41M2 12h2m16 0h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
html.dark-mode .icon-sun { display: block; }
html.dark-mode .icon-moon { display: none; }

/* ---- Auth skeleton loader ---- */
.auth-skeleton {
    width: 150px;
    height: 42px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 0.35; }
    100% { opacity: 0.7; }
}

/* ---- Global tropical buttons ---- */
.btn,
.btn-cta,
.btn-upload,
.btn-submit,
.btn-upgrade,
.btn-upgrade-cta {
    background: linear-gradient(135deg, var(--btn-gradient-start) 0%, var(--btn-gradient-end) 100%);
    color: var(--btn-text-color);
    border: none;
    padding: 0.7rem 1.1rem;
    border-radius: 10px;
    font-family: var(--font-ui);
    font-weight: 700;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.btn-theme-toggle,
.btn-close-page {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.page {
    position: relative;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
}

.page-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    --panel-left: clamp(386px, 23vw, 422px);
    --panel-width: calc(100vw - var(--panel-left));
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}
html.dark-mode .page-overlay {
    background: rgba(4, 22, 28, 0.24);
}

/* NOTE: .page-overlay has a backdrop-filter, which makes it the containing
   block for positioned children — so top/right/bottom here are relative to
   the overlay (which starts below the 100px header), not the viewport.
   12px top / 18px bottom mirrors the left home panel (88px / 18px). */
.page-overlay .page-content {
    position: absolute;
    left: var(--panel-left);
    top: 112px;
    right: 0;
    bottom: 18px;
    width: auto;
    background: var(--surface-solid);
    color: var(--text-primary);
    box-shadow: -18px 0 48px var(--shadow-color);
    border: 1px solid var(--border-color);
    border-radius: 20px 0 0 20px;
    overflow-y: auto;
    padding: 0 clamp(26px, 3vw, 56px) 32px;
    z-index: 91 !important;
    -webkit-backdrop-filter: saturate(140%) blur(18px);
    backdrop-filter: saturate(140%) blur(18px);
}

.page-overlay.is-closing {
    pointer-events: none;
    animation: overlayFadeOut 0.32s ease forwards;
}

.page-overlay.is-opening .page-content {
    animation: panelOpen 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.page-overlay.is-closing .page-content {
    animation: panelClose 0.32s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.page-overlay .btn-close-page {
    position: absolute;
    top: 26px;
    right: clamp(28px, 3vw, 48px);
    z-index: 92;
    font-size: 0;
    background: var(--surface-solid);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.page-overlay .btn-close-page::before,
.page-overlay .btn-close-page::after {
    content: "";
    position: absolute;
    width: 15px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.page-overlay .btn-close-page::before {
    transform: rotate(45deg);
}

.page-overlay .btn-close-page::after {
    transform: rotate(-45deg);
}

.slide-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-right: 52px;
    margin: 0 0 22px;
    padding-top: clamp(16px, 2.4vh, 28px);
}

.slide-kicker { display: none; }

/* Panel headline mirrors the home hero title (size, font, weight). */
.slide-head h1 {
    margin: 0;
    color: var(--text-primary);
    font-size: clamp(32px, 3.2vw, 52px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 700;
}

.slide-intro {
    max-width: 740px;
    margin: 14px 0 0;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.6;
}

@keyframes overlayFadeOut {
    to {
        opacity: 0;
        -webkit-backdrop-filter: blur(0);
        backdrop-filter: blur(0);
    }
}

@keyframes panelOpen {
    from {
        transform: translateX(102%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes panelClose {
    to {
        transform: translateX(102%);
    }
}

@media (max-width: 920px) {
    .page-overlay {
        --panel-left: 0px;
        --panel-width: 100vw;
    }

    .page-overlay .btn-close-page {
        right: 18px;
    }

    .page-overlay .page-content {
        top: 100px;
        right: 0;
        bottom: 0;
        border-radius: 0;
    }

    .slide-head {
        padding-right: 52px;
    }
}

/* ===== Phone (<=560px): tighten panels, guard against horizontal scroll ===== */
@media (max-width: 560px) {
    html, body {
        overflow-x: hidden;
    }

    .page-overlay .page-content {
        padding: 0 16px 24px;
    }

    .slide-head {
        flex-direction: column;
        gap: 12px;
        padding-right: 44px;
    }

    .slide-intro {
        font-size: 0.98rem;
    }

    /* Comfortable tap targets on touch screens. */
    .btn-close-page,
    .primary-btn,
    .secondary-btn,
    .btn-cta,
    .btn-submit {
        min-height: 44px;
    }
}

h1, h2 { font-family: var(--font-display); }

/* ===================================================================
   Blazor framework boilerplate (kept)
   =================================================================== */
a, .btn-link { color: var(--accent); }

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.content { padding-top: 1.1rem; }

h1:focus { outline: none; }

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1.25rem;
    color: white;
}
.blazor-error-boundary::after { content: "An error has occurred."; }

.darker-border-checkbox.form-check-input { border-color: #929292; }

/* ---- Legal pages (Impressum / Datenschutz) ---- */
.legal-body {
    max-width: 760px;
    line-height: 1.6;
    color: var(--text-primary);
}
.legal-body h2 {
    margin: 1.6rem 0 0.5rem;
    font-size: 1.15rem;
}
.legal-body h3 {
    margin: 1.1rem 0 0.3rem;
    font-size: 1rem;
}
.legal-body p,
.legal-body ul {
    margin: 0 0 0.8rem;
    color: var(--text-secondary);
}
.legal-body ul {
    padding-left: 1.2rem;
}
.legal-body a {
    color: var(--accent);
}
.legal-updated {
    margin-top: 1.6rem;
    font-size: 0.85rem;
    opacity: 0.7;
}

/* ---- Footer with legal links ---- */
.legal-footer {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 7px 16px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    z-index: 20;
}
.legal-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}
.legal-footer a:hover,
.legal-footer a:focus-visible {
    color: var(--accent);
    text-decoration: underline;
}
@media (max-width: 820px) {
    .legal-footer { bottom: 8px; left: 12px; right: 12px; transform: none; width: fit-content; margin-inline: auto; gap: 4px 9px; padding: 6px 12px; font-size: 11px; flex-wrap: wrap; justify-content: center; white-space: normal; box-sizing: border-box; }
}

#blazor-error-ui {
    display: none;
    position: fixed;
    left: 50%;
    bottom: 64px;
    transform: translateX(-50%);
    max-width: calc(100% - 32px);
    box-sizing: border-box;
    padding: 12px 44px 12px 16px;
    border-radius: 12px;
    background: var(--surface-solid);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 16px 40px var(--shadow-color);
    font-size: 14px;
    z-index: 10000;
}
#blazor-error-ui .reload {
    margin-left: 8px;
    color: var(--accent);
    font-weight: 600;
}
#blazor-error-ui .dismiss {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    cursor: pointer;
}

#blazor-error-ui { display: none; }

/* Loading screen shown until Blazor initializes */
#app-loading {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #e9f6f5 0%, #f7fbf9 55%, #fdf6e7 100%);
    z-index: 9999;
    transition: opacity 0.35s ease-out;
}

html.dark-mode #app-loading {
    background: linear-gradient(180deg, #071820 0%, #0b1f27 60%, #10262b 100%);
}

#app-loading.loaded {
    opacity: 0;
    pointer-events: none;
}

.loading-mark {
    width: min(168px, 42vw);
    height: auto;
    overflow: visible;
    opacity: 1;
}

.loading-progress {
    position: relative;
    width: 120px;
    height: 3px;
    overflow: hidden;
    border-radius: 3px;
    background: rgba(14, 42, 49, 0.1);
}

.loading-progress::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--blazor-load-percentage, 0%);
    border-radius: 3px;
    background: #11b7aa;
    transition: width 0.2s ease-out;
}

html.dark-mode .loading-progress {
    background: rgba(255, 255, 255, 0.12);
}

.loading-mark #wave-1,
.loading-mark #wave-2 {
    animation: loader-wave-in 0.5s ease-out both, loader-wave-drift 3.2s ease-in-out 1.6s infinite alternate;
}

.loading-mark #wave-2 {
    animation-delay: 0.1s, 1.7s;
}

.loading-mark #island {
    animation: loader-rise 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) 0.15s both;
}

.loading-mark #trunk,
.loading-mark #trunk-segments {
    transform-origin: 150px 272px;
    animation: loader-grow 0.55s cubic-bezier(0.3, 0.7, 0.3, 1) 0.45s both;
}

.loading-mark #palm {
    transform-origin: 177px 72px;
    animation: loader-sway 3.2s ease-in-out 1.6s infinite alternate;
}

.loading-mark [id^="frond-"] {
    transform-origin: 177px 72px;
    animation: loader-unfold 0.5s cubic-bezier(0.25, 1.4, 0.5, 1) both;
}

.loading-mark #frond-3 { animation-delay: 0.9s; }
.loading-mark #frond-4 { animation-delay: 0.97s; }
.loading-mark #frond-2 { animation-delay: 1.04s; }
.loading-mark #frond-5 { animation-delay: 1.11s; }
.loading-mark #frond-1 { animation-delay: 1.18s; }
.loading-mark #frond-6 { animation-delay: 1.25s; }

.loading-mark #file > path {
    animation: loader-file 0.45s cubic-bezier(0.25, 1.3, 0.5, 1) 1.3s both;
}

@keyframes loader-wave-in {
    from { opacity: 0; transform: translateX(-14px); }
    to { opacity: 1; transform: none; }
}

@keyframes loader-wave-drift {
    from { transform: translateX(0); }
    to { transform: translateX(5px); }
}

@keyframes loader-rise {
    from { opacity: 0; transform: translateY(28px); }
    to { opacity: 1; transform: none; }
}

@keyframes loader-grow {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

@keyframes loader-unfold {
    from { opacity: 0; transform: scale(0.15) rotate(-12deg); }
    to { opacity: 1; transform: none; }
}

@keyframes loader-file {
    from { transform: translateY(70px); }
    to { transform: none; }
}

@keyframes loader-sway {
    from { transform: rotate(-2deg); }
    to { transform: rotate(2deg); }
}

@media (prefers-reduced-motion: reduce) {
    .loading-mark *,
    .loading-mark #palm {
        animation: none !important;
    }
}
