:root {
    color-scheme: dark;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background-image:
        radial-gradient(circle at top, rgba(34, 211, 238, 0.12), transparent 30%),
        linear-gradient(180deg, rgba(15, 23, 42, 1) 0%, rgba(2, 6, 23, 1) 100%);
}

input,
select,
textarea {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff !important;
}

input::placeholder,
textarea::placeholder {
    color: #94a3b8 !important;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff !important;
}

.hero-home-grid {
    border: 1px solid rgba(148, 163, 184, 0.1);
    background:
        linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px),
        radial-gradient(circle at 20% 20%, rgba(34, 211, 238, 0.1), rgba(15, 23, 42, 0.35));
    background-size: 28px 28px, 28px 28px, 100% 100%;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.95), transparent 96%);
}

.hero-home-glow {
    background: radial-gradient(circle, rgba(34, 211, 238, 0.22), rgba(34, 211, 238, 0));
    filter: blur(6px);
}

.hero-home-glow-alt {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0));
}

.hero-home-dot {
    box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.75);
    animation: heroPulse 2.5s ease-out infinite;
}

.hero-stat {
    transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.hero-stat:hover {
    transform: translateY(-3px);
    border-color: rgba(34, 211, 238, 0.4);
    background: rgba(15, 23, 42, 0.92);
}

html.light .mhd-agua-headline {
    color: #000 !important;
}

.mhd-white-map {
    filter: brightness(1.6) saturate(0.35) contrast(0.85);
    opacity: 0.95;
    background: transparent;
}

@keyframes heroPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.75);
    }
    75% {
        box-shadow: 0 0 0 12px rgba(34, 211, 238, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 211, 238, 0);
    }
}

/* Flip Card Styles */
.flip-card {
    perspective: 1000px;
    height: 400px;
    width: 100%;
    overflow: hidden;
    border-radius: 1rem;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.flip-card-front {
    background-color: transparent;
    color: white;
    z-index: 2;
}

.flip-card-back {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    transform: rotateY(180deg);
    z-index: 1;
    padding: 1.5rem;
    justify-content: center;
}

.glass-card {
    backdrop-filter: blur(18px);
}

.tech-panel {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.32);
    backdrop-filter: blur(18px);
}

.hover-lift {
    transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

/* ── Leaflet: Tailwind preflight sets img{max-width:100%} which breaks tiles ── */
.leaflet-container img {
    max-width: none !important;
    max-height: none !important;
    display: block;
}
.leaflet-tile-container img,
.leaflet-tile {
    max-width: none !important;
    width: 256px !important;
    height: 256px !important;
}

.hover-lift:hover {
    transform: translateY(-4px);
}

input,
select,
textarea {
    width: 100%;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #f8fafc;
    padding: 0.85rem 1rem;
}

input::placeholder,
textarea::placeholder {
    color: #64748b;
}

a,
button {
    transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.auth-form label {
    color: #cbd5e1;
}

.auth-form input {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 23, 42, 0.65);
    color: #fff;
}

.auth-form input::placeholder {
    color: #334155;
}

.auth-form input:focus {
    outline: none;
    border-color: rgba(34, 211, 238, 0.6);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18);
}

.registration-form label {
    color: #0f172a !important;
}

.registration-form input,
.registration-form select,
.registration-form textarea {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid rgba(15, 23, 42, 0.2) !important;
}

.registration-form input::placeholder,
.registration-form textarea::placeholder {
    color: #64748b !important;
}

.registration-form select option {
    color: #0f172a;
    background: #ffffff;
}

html:not(.light) input,
html:not(.light) textarea,
html:not(.light) select {
    color: #0f172a !important;
}

html:not(.light) label,
html:not(.light) .registration-form label {
    color: #f8fafc !important;
}

html:not(.light) .registration-form input,
html:not(.light) .registration-form textarea,
html:not(.light) .registration-form select {
    color: #f8fafc !important;
    background: rgba(15, 23, 42, 0.65) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

html:not(.light) .registration-form input::placeholder,
html:not(.light) .registration-form textarea::placeholder {
    color: #94a3b8 !important;
}

html:not(.light) .registration-form select option {
    color: #f8fafc;
    background: #0f172a;
}

.registration-form .field-invalid {
    border-color: rgba(251, 113, 133, 0.9) !important;
    box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.18);
}

.registration-form .field-valid {
    border-color: rgba(34, 197, 94, 0.75) !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}