* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    font-family: Inter, Arial, sans-serif;
    background: #d7dde5;
}

body.map-page {
    overflow: hidden;
    color: #111827;
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: inherit;
}

#appMap {
    position: fixed;
    inset: 0;
    z-index: 1;
}

.map-topbar {
    position: fixed;
    top: 18px;
    left: 60px;
    right: 18px;
    z-index: 1200;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    pointer-events: none;
}

.topbar-left,
.topbar-right {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    pointer-events: auto;
}

.brand-pill,
.topbar-btn,
.user-pill {
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    text-decoration: none;
    backdrop-filter: blur(12px);
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.20);
}

.brand-pill,
.user-pill,
.topbar-btn {
    background: rgba(255, 255, 255, 0.93);
    color: #111827;
}

.brand-pill {
    font-weight: 800;
}

.user-pill {
    font-weight: 600;
}

.topbar-btn {
    cursor: pointer;
    font-weight: 700;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.topbar-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.24);
}

.topbar-btn-primary {
    background: #0f172a;
    color: #fff;
}

.topbar-btn-danger {
    background: #b91c1c;
    color: #fff;
}

.legend-card {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 1100;
    width: min(380px, calc(100vw - 36px));
    padding: 22px 22px 18px;
    background: rgba(255, 255, 255, 0.93);
    border-radius: 24px;
    backdrop-filter: blur(14px);
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.22);
}

.legend-card h1 {
    margin: 0 0 10px;
    font-size: 28px;
}

.legend-card p {
    margin: 0 0 16px;
    line-height: 1.55;
    color: #334155;
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    color: #1f2937;
    font-weight: 600;
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.45);
}

.legend-green { background: #22c55e; }
.legend-yellow { background: #facc15; }
.legend-red { background: #ef4444; }

.floating-alert {
    position: fixed;
    top: 86px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1300;
    min-width: 260px;
    max-width: calc(100vw - 40px);
    padding: 14px 18px;
    border-radius: 16px;
    color: #fff;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
}

.floating-alert-success { background: #166534; }
.floating-alert-error { background: #991b1b; }

.overlay-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1400;
    background: rgba(2, 6, 23, 0.34);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s ease, visibility .22s ease;
}

.overlay-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.overlay-shell {
    position: absolute;
    top: 84px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    width: min(760px, calc(100vw - 28px));
    max-height: calc(100vh - 110px);
    overflow: auto;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 28px;
    box-shadow: 0 32px 90px rgba(2, 6, 23, 0.32);
    opacity: 0;
    transition: opacity .22s ease, transform .22s ease;
}

.overlay-shell.is-open {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.overlay-close {
    position: sticky;
    top: 16px;
    float: right;
    margin: 16px 16px 0 0;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 28px;
    cursor: pointer;
    z-index: 2;
}

.overlay-panel {
    display: none;
    padding: 28px;
    clear: both;
}

.overlay-panel.is-active {
    display: block;
}

.overlay-header h2 {
    margin: 0 0 8px;
    font-size: 30px;
}

.overlay-header p {
    margin: 0 0 20px;
    color: #475569;
    line-height: 1.55;
}

.overlay-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.overlay-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.overlay-form label span {
    font-weight: 700;
    color: #0f172a;
}

.overlay-form input,
.overlay-form select,
.overlay-form textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    background: #fff;
    padding: 14px 15px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.overlay-form input:focus,
.overlay-form select:focus,
.overlay-form textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.full-width {
    grid-column: 1 / -1;
}

.check-line {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 10px;
}

.check-line input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.gps-status-box {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 18px;
    border-radius: 20px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.gps-status-box p {
    margin: 6px 0 0;
    color: #334155;
}

.coords-preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.coords-preview > div {
    padding: 14px 16px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.coords-preview span {
    color: #64748b;
}

.submit-btn,
.link-like-btn {
    border: 0;
    border-radius: 16px;
    padding: 15px 18px;
    cursor: pointer;
    font-weight: 800;
}

.submit-btn {
    background: #0f172a;
    color: #fff;
}

.link-like-btn {
    background: transparent;
    color: #2563eb;
    text-align: left;
    padding-left: 0;
}

.alert {
    margin: 0 0 14px;
    border-radius: 16px;
    padding: 14px 16px;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.empty-state {
    padding: 28px;
    border-radius: 22px;
    text-align: center;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
}

.empty-state.compact {
    padding: 24px;
}

.empty-state h3 {
    margin: 0 0 10px;
}

.empty-state p {
    margin: 0 0 16px;
    color: #475569;
}

.report-list {
    display: grid;
    gap: 14px;
}

.report-list-item {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 16px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    background: #fff;
}

.report-list-media img,
.report-list-media video {
    width: 100%;
    height: 126px;
    object-fit: cover;
    border-radius: 16px;
    display: block;
    background: #cbd5e1;
}

.report-list-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.report-list-content h3 {
    margin: 0 0 8px;
}

.report-list-content p {
    margin: 0 0 10px;
    color: #475569;
    line-height: 1.5;
}

.report-list-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    color: #64748b;
    font-size: 14px;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 12px;
    background: #e2e8f0;
    font-weight: 700;
    font-size: 13px;
}

.badge-green { background: #dcfce7; color: #166534; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }

.custom-pin-wrapper {
    background: transparent;
    border: 0;
}

.custom-pin {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.36);
}

.custom-pin::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -7px;
    width: 10px;
    height: 10px;
    transform: translateX(-50%) rotate(45deg);
    background: inherit;
    border-right: 2px solid rgba(255, 255, 255, 0.95);
    border-bottom: 2px solid rgba(255, 255, 255, 0.95);
}

.custom-pin-green { background: #22c55e; }
.custom-pin-yellow { background: #facc15; }
.custom-pin-red { background: #ef4444; }
.custom-pin-blue { background: #3b82f6; }

.map-popup-card {
    width: 260px;
}

.map-popup-card img,
.map-popup-card video {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 14px;
    display: block;
    margin-bottom: 10px;
    background: #cbd5e1;
}

.map-popup-card h4 {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.3;
}

.map-popup-card p {
    margin: 0 0 8px;
    color: #475569;
    line-height: 1.45;
}

.popup-meta {
    font-size: 13px;
    color: #64748b;
}

.confirm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.confirm-btn {
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    background: #0f172a;
    color: #fff;
    cursor: pointer;
    font-weight: 800;
}

.confirm-btn.is-active {
    background: #166534;
}

.confirm-btn[disabled] {
    cursor: not-allowed;
    opacity: .72;
}

.confirm-count {
    font-weight: 800;
    color: #0f172a;
}

.leaflet-popup-content-wrapper {
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.leaflet-popup-content {
    margin: 14px;
}

.leaflet-popup-close-button {
    font-size: 22px !important;
    padding: 8px 10px 0 0 !important;
}

.leaflet-container {
    background: #cbd5e1;
}

@media (max-width: 900px) {
    .legend-card {
        width: min(340px, calc(100vw - 24px));
        left: 12px;
        bottom: 12px;
        padding: 18px;
    }

    .map-topbar {
        top: 12px;
        left: 12px;
        right: 12px;
    }

    .overlay-shell {
        top: 78px;
        width: calc(100vw - 20px);
        max-height: calc(100vh - 90px);
    }
}

@media (max-width: 720px) {
    .overlay-form,
    .coords-preview,
    .report-list-item {
        grid-template-columns: 1fr;
    }

    .gps-status-box {
        flex-direction: column;
        align-items: stretch;
    }

    .legend-card {
        right: 12px;
        left: 12px;
        width: auto;
    }

    .topbar-left,
    .topbar-right {
        gap: 8px;
    }

    .brand-pill,
    .topbar-btn,
    .user-pill {
        padding: 10px 14px;
        font-size: 14px;
    }

    .overlay-panel {
        padding: 22px 18px 20px;
    }
}


/* === RadarPublic update: guest reporting, filters, publication date, severity === */

.filter-card {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1100;
    width: min(320px, calc(100vw - 36px));
    padding: 16px;
    background: rgba(255, 255, 255, 0.94);
    border-radius: 22px;
    backdrop-filter: blur(14px);
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.20);
}

.filter-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.filter-card-header strong {
    color: #0f172a;
}

.filter-reset {
    border: 0;
    border-radius: 999px;
    padding: 7px 11px;
    background: #e2e8f0;
    color: #0f172a;
    cursor: pointer;
    font-weight: 800;
    font-size: 13px;
}

.filter-card select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 12px 13px;
    background: #fff;
    outline: none;
    font-weight: 700;
}

.guest-info-box {
    margin-bottom: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
}

.severity-picker {
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.severity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    color: #0f172a;
    font-weight: 800;
}

.severity-header strong {
    font-size: 18px;
}

.severity-dots {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 8px;
}

.severity-dot-label {
    cursor: pointer;
}

.severity-dot-label input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.severity-dot-label span {
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    color: #0f172a;
    font-weight: 900;
    border: 2px solid transparent;
    transition: transform .16s ease, background .16s ease, color .16s ease, border-color .16s ease;
}

.severity-dot-label span:hover {
    transform: translateY(-2px);
}

.severity-dot-label input:checked + span {
    background: #0f172a;
    color: #fff;
    border-color: #38bdf8;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.22);
}

.severity-help {
    margin: 12px 0 0;
    color: #64748b;
    font-size: 14px;
}

.popup-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0 0 9px;
}

.popup-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    background: #e2e8f0;
    color: #0f172a;
    font-weight: 800;
    font-size: 12px;
}

.popup-badge-severity,
.badge-severity {
    background: #ffedd5;
    color: #9a3412;
}

@media (max-width: 900px) {
    .filter-card {
        right: 12px;
        bottom: 190px;
    }
}

@media (max-width: 720px) {
    .filter-card {
        left: 12px;
        right: 12px;
        bottom: 210px;
        width: auto;
    }

    .severity-dots {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* === Legal consent modal + cookies === */

.legal-consent-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.legal-consent-overlay.is-visible {
    display: flex;
}

.legal-consent-box {
    width: min(760px, 100%);
    max-height: min(88vh, 820px);
    background: rgba(255, 255, 255, 0.98);
    border-radius: 28px;
    box-shadow: 0 35px 100px rgba(0, 0, 0, 0.35);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.legal-consent-header h2 {
    margin: 0 0 8px;
    font-size: 28px;
    color: #0f172a;
}

.legal-consent-header p {
    margin: 0;
    color: #475569;
    line-height: 1.5;
}

.legal-consent-scroll {
    max-height: 310px;
    overflow-y: auto;
    padding: 18px;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    line-height: 1.6;
}

.legal-consent-scroll h3 {
    margin: 18px 0 8px;
    color: #0f172a;
    font-size: 17px;
}

.legal-consent-scroll h3:first-child {
    margin-top: 0;
}

.legal-consent-scroll p {
    margin: 0 0 12px;
}

.legal-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    border-radius: 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #0f172a;
    font-weight: 700;
    cursor: pointer;
}

.legal-check input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex: 0 0 auto;
}

.cookie-choice-box {
    padding: 16px;
    border-radius: 20px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.cookie-choice-box h3 {
    margin: 0 0 6px;
    color: #9a3412;
}

.cookie-choice-box p {
    margin: 0 0 12px;
    color: #7c2d12;
    line-height: 1.5;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cookie-choice-status {
    margin-top: 10px !important;
    font-weight: 800;
}

.legal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.legal-accept-btn,
.legal-decline-btn,
.legal-secondary-btn {
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 900;
    cursor: pointer;
}

.legal-accept-btn {
    background: #0f172a;
    color: #fff;
}

.legal-accept-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.legal-decline-btn {
    background: #fee2e2;
    color: #991b1b;
}

.legal-secondary-btn {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #fdba74;
}

@media (max-width: 720px) {
    .legal-consent-overlay {
        padding: 0;
        align-items: stretch;
        justify-content: flex-end;
    }

    .legal-consent-box {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        padding: 14px;
        overflow-y: auto;
        gap: 12px;
    }

    .legal-consent-header {
        flex: 0 0 auto;
    }

    .legal-consent-header h2 {
        font-size: 21px;
        line-height: 1.2;
    }

    .legal-consent-header p {
        font-size: 14px;
    }

    .legal-consent-scroll {
        max-height: none;
        height: 46dvh;
        min-height: 300px;
        overflow-y: auto;
        padding: 14px;
        font-size: 14px;
        -webkit-overflow-scrolling: touch;
    }

    .legal-check,
    .cookie-choice-box,
    .legal-actions {
        flex: 0 0 auto;
    }

    .cookie-choice-box {
        padding: 13px;
    }

    .cookie-choice-box h3 {
        font-size: 16px;
    }

    .cookie-choice-box p {
        font-size: 13px;
    }

    .legal-actions,
    .cookie-buttons {
        flex-direction: column;
    }

    .legal-accept-btn,
    .legal-decline-btn,
    .legal-secondary-btn {
        width: 100%;
        text-align: center;
        padding: 12px 14px;
    }
}

/* === STRICT MOBILE: hartă aerisită + UI organizat === */
.mobile-map-actions {
    display: none;
}

@media (max-width: 720px) {
    .map-topbar {
        top: 10px;
        left: 64px;
        right: 10px;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
        gap: 8px;
        pointer-events: none;
    }

    .topbar-left {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        pointer-events: auto;
    }

    .topbar-right {
        display: flex;
        justify-content: flex-end;
        align-items: flex-start;
        gap: 6px;
        min-width: 0;
        pointer-events: auto;
    }

    .brand-pill,
    .topbar-btn,
    .user-pill {
        padding: 8px 10px;
        font-size: 12px;
        border-radius: 999px;
        white-space: nowrap;
        max-width: 100%;
    }

    .brand-pill {
        width: fit-content;
        max-width: 118px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-left .topbar-btn {
        width: fit-content;
        max-width: 118px;
    }

    .topbar-right .topbar-btn,
    .topbar-right .user-pill {
        max-width: 76px;
        overflow: hidden;
        text-overflow: ellipsis;
        padding-left: 9px;
        padding-right: 9px;
    }

    .topbar-right .topbar-btn-danger {
        max-width: 72px;
    }

    .mobile-map-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        position: fixed;
        right: 10px;
        bottom: 18px;
        z-index: 1250;
        gap: 6px;
        padding: 6px;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.78);
        backdrop-filter: blur(14px);
        box-shadow: 0 16px 45px rgba(15, 23, 42, 0.22);
    }

    .mobile-map-btn {
        border: 0;
        border-radius: 14px;
        padding: 10px 12px;
        min-width: 68px;
        background: #0f172a;
        color: #fff;
        font-size: 12px;
        font-weight: 900;
        cursor: pointer;
    }

    .legend-card,
    .filter-card {
        display: none;
    }

    .legend-card.mobile-panel-open,
    .filter-card.mobile-panel-open {
        display: block;
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 86px;
        width: auto;
        z-index: 1300;
        border-radius: 20px;
        padding: 14px;
        max-height: 45vh;
        overflow: auto;
    }

    .legend-card h1 {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .legend-card p {
        font-size: 13px;
        line-height: 1.4;
        margin-bottom: 8px;
    }

    .legend-row {
        font-size: 13px;
        margin-top: 5px;
    }

    .filter-card-header {
        margin-bottom: 8px;
    }

    .filter-card select {
        padding: 10px;
        font-size: 13px;
    }

    .leaflet-top.leaflet-left {
        top: 10px;
        left: 10px;
    }

    .leaflet-control-zoom a {
        width: 36px !important;
        height: 36px !important;
        line-height: 36px !important;
    }
}