:root {
    color-scheme: light;
    --hematix-bg: #f5f9ff;
    --hematix-surface: rgba(255, 255, 255, 0.88);
    --hematix-border: rgb(226 232 240 / 0.95);
    --hematix-text: rgb(15 23 42);
    --hematix-muted: rgb(100 116 139);
    --hematix-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--hematix-bg);
    color: var(--hematix-text);
}

.glass-panel {
    border-radius: 1.5rem;
    border: 1px solid var(--hematix-border);
    background: var(--hematix-surface);
    padding: 1.25rem;
    box-shadow: var(--hematix-shadow);
    backdrop-filter: blur(16px);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.glass-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.11);
}

.panel-heading {
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--hematix-text);
}

.section-subtitle {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.5rem;
    color: var(--hematix-muted);
}

.field {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(51 65 85);
}

.field.compact {
    display: block;
}

.field > span {
    display: block;
    margin-bottom: 0.5rem;
}

.input-field,
.file-field {
    display: block;
    width: 100%;
    border-radius: 1rem;
    border: 1px solid rgb(203 213 225);
    background: #ffffff;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: rgb(15 23 42);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease, background-color 150ms ease;
}

.file-field {
    padding: 0.75rem;
}

.input-field::placeholder,
.file-field::placeholder {
    color: rgb(148 163 184);
}

.input-field:focus,
.file-field:focus {
    border-color: rgb(46 131 255);
    box-shadow: 0 0 0 4px rgba(46, 131, 255, 0.14);
}

.input-field:hover,
.file-field:hover {
    border-color: rgb(148 163 184);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 1rem;
    background: linear-gradient(90deg, rgb(31 103 214), rgb(31 85 173));
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(31, 103, 214, 0.18);
    transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease, background 150ms ease;
    cursor: pointer;
}

.btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(46, 131, 255, 0.14), 0 12px 24px rgba(31, 103, 214, 0.18);
}

.map-shell {
    height: 22rem;
    width: 100%;
    overflow: hidden;
    border-radius: 1.25rem;
    border: 1px solid rgb(226 232 240);
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.65), rgba(255, 255, 255, 0.95));
}

.leaflet-container {
    font-family: inherit;
}

.skeleton {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, rgb(226 232 240), rgb(241 245 249), rgb(226 232 240));
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .glass-panel,
    .btn-primary,
    .input-field,
    .file-field,
    .skeleton {
        animation: none;
        transition: none;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --hematix-bg: #08111d;
        --hematix-surface: rgba(10, 18, 31, 0.86);
        --hematix-border: rgb(51 65 85 / 0.72);
        --hematix-text: rgb(241 245 249);
        --hematix-muted: rgb(148 163 184);
        --hematix-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    }

    .glass-panel,
    .map-shell,
    .input-field,
    .file-field,
    .bg-white,
    .bg-white\/70,
    .bg-white\/80,
    .bg-white\/90,
    .bg-white\/92 {
        background-color: rgba(10, 18, 31, 0.88) !important;
        color: var(--hematix-text);
    }

    .section-title,
    .field,
    .text-slate-900 {
        color: var(--hematix-text) !important;
    }

    .section-subtitle,
    .text-slate-600,
    .text-slate-500 {
        color: var(--hematix-muted) !important;
    }
}

@media (max-width: 640px) {
    .map-shell {
        height: 18rem;
    }
}
