/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:    #E63946;
    --primary-dk: #c1121f;
    --primary-lt: #fde8ea;
    --secondary:  #1D3557;
    --secondary-lt: #e8edf3;
    --accent:     #457B9D;
    --bg:         #F4F6F9;
    --bg-card:    #FFFFFF;
    --text:       #1a1a2e;
    --text-muted: #6C757D;
    --border:     #e0e4ea;
    --success:    #1a7a4a;
    --warning:    #b45309;
    --danger:     #E63946;
    --radius:     14px;
    --radius-sm:  8px;
    --shadow:     0 2px 16px rgba(29,53,87,.08);
    --shadow-lg:  0 8px 40px rgba(29,53,87,.14);
    --transition: .2s ease;
}

html { scroll-behavior: smooth; }

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ===== NAVBAR ===== */
.navbar {
    background: #ffffff;
    box-shadow: 0 1px 0 var(--border), var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 66px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--secondary);
    text-decoration: none;
    letter-spacing: -.3px;
}

.nav-brand:hover { text-decoration: none; color: var(--primary); }

/* Logo cu fundal alb garantat, vizibil pe orice temă */
.nav-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: #ffffff;
    padding: 3px;
    border: 1.5px solid var(--border);
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: .15rem;
    list-style: none;
}

.nav-menu li a {
    display: block;
    padding: .45rem .8rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: .9rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
}

.nav-menu li a:hover {
    background: var(--bg);
    color: var(--primary);
    text-decoration: none;
}

.btn-nav-register {
    background: var(--primary) !important;
    color: #fff !important;
    font-weight: 700 !important;
    border-radius: 50px !important;
    padding: .45rem 1.1rem !important;
}

.btn-nav-register:hover {
    background: var(--primary-dk) !important;
    color: #fff !important;
}

.btn-nav-logout {
    color: var(--text-muted) !important;
    font-size: .85rem !important;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: .5rem;
    border-radius: var(--radius-sm);
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== MAIN ===== */
.main-content { flex: 1; min-height: 0; }

/* ===== ALERTS ===== */
.alert {
    max-width: 1200px;
    margin: 1rem auto;
    padding: .875rem 1.25rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: .9rem;
}

.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

.alert-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: .6;
    line-height: 1;
}

.alert-close:hover { opacity: 1; }

/* ===== CONTAINER ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.container-sm {
    max-width: 480px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, #1D3557 0%, #457B9D 60%, #E63946 100%);
    color: #fff;
    padding: 5rem 1.25rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

/* Logo în hero — pe fundal alb rotunjit, vizibil */
.hero-logo {
    width: 90px;
    height: 90px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 20px;
    padding: 10px;
    margin: 0 auto 1.75rem;
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
    position: relative;
}

.hero h1 {
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
    position: relative;
}

.hero p {
    font-size: 1.1rem;
    opacity: .92;
    max-width: 560px;
    margin: 0 auto 2.25rem;
    position: relative;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem 1.5rem;
    border-radius: 50px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dk);
    border-color: var(--primary-dk);
    text-decoration: none;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(230,57,70,.35);
}

.btn-secondary {
    background: var(--secondary);
    color: #fff;
    border-color: var(--secondary);
}

.btn-secondary:hover {
    background: #162840;
    border-color: #162840;
    color: #fff;
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}

.btn-white {
    background: #fff;
    color: var(--secondary);
    border-color: #fff;
}

.btn-white:hover {
    background: var(--bg);
    text-decoration: none;
    color: var(--secondary);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-danger:hover { background: #c1121f; border-color: #c1121f; color: #fff; text-decoration: none; }

.btn-sm { padding: .35rem .9rem; font-size: .82rem; }
.btn-lg { padding: .85rem 2rem; font-size: 1.05rem; }
.btn-block { width: 100%; justify-content: center; }

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: box-shadow var(--transition), transform var(--transition);
    border: 1px solid var(--border);
}

.card:hover { box-shadow: var(--shadow-lg); }

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: .75rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.1rem; }

.form-label {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: .35rem;
}

.form-control {
    width: 100%;
    padding: .65rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: .95rem;
    color: var(--text);
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(230,57,70,.12);
}

textarea.form-control { resize: vertical; min-height: 100px; }

.form-error {
    font-size: .8rem;
    color: var(--danger);
    margin-top: .25rem;
}

.form-hint {
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: .25rem;
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin-bottom: .75rem;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.form-check label { font-size: .9rem; cursor: pointer; }

.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-card {
    flex: 1;
    min-width: 120px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.radio-card:has(input:checked) {
    border-color: var(--primary);
    background: #fff5f5;
}

.radio-card input { display: none; }
.radio-card .radio-icon { font-size: 2rem; display: block; margin-bottom: .25rem; }
.radio-card .radio-label { font-size: .9rem; font-weight: 600; }

/* ===== STARS ===== */
.stars { display: inline-flex; gap: 1px; }
.star { color: #dee2e6; font-size: 1.1rem; }
.star.filled { color: #f4a261; }

.star-input { display: flex; gap: .25rem; flex-direction: row-reverse; justify-content: flex-end; }
.star-input input { display: none; }
.star-input label {
    font-size: 2rem;
    color: #dee2e6;
    cursor: pointer;
    transition: color var(--transition);
}
.star-input input:checked ~ label,
.star-input label:hover,
.star-input label:hover ~ label { color: #f4a261; }

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 50px;
    font-size: .75rem;
    font-weight: 600;
}

.badge-success  { background: #d1fae5; color: #065f46; }
.badge-warning  { background: #fef3c7; color: #92400e; }
.badge-danger   { background: #fee2e2; color: #991b1b; }
.badge-info     { background: #dbeafe; color: #1e40af; }
.badge-secondary{ background: #e9ecef; color: #495057; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    font-size: .9rem;
}

thead th {
    background: var(--secondary);
    color: #fff;
    padding: .75rem 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:hover { background: #f8f9fa; }
tbody td { padding: .75rem 1rem; vertical-align: middle; }
tbody tr:last-child { border-bottom: none; }

/* ===== MAP ===== */
.map-container {
    width: 100%;
    height: 450px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
}

.map-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.map-btn {
    background: #fff;
    border: none;
    border-radius: 8px;
    padding: .5rem .75rem;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    color: var(--secondary);
}

.map-btn:hover { background: var(--primary); color: #fff; }

/* ===== STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    text-align: center;
    border-top: 4px solid var(--primary);
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: .85rem;
    color: var(--text-muted);
    margin-top: .25rem;
}

/* ===== PAGE HEADER ===== */
.page-header {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
    color: #fff;
    padding: 2.5rem 1.25rem;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -.3px;
}

.page-header p { opacity: .85; margin-top: .35rem; font-size: .95rem; }

/* ===== AUTH PAGES ===== */
.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    margin-top: 2rem;
    border: 1px solid var(--border);
}

.auth-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Logo auth — fundal alb, vizibil */
.auth-logo {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin: 0 auto 1.25rem;
    border-radius: 16px;
    background: #ffffff;
    padding: 8px;
    border: 2px solid var(--border);
    box-shadow: var(--shadow);
}

.auth-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: .9rem;
    color: var(--text-muted);
}

/* ===== CTA SECTION ===== */
.cta-section {
    background: linear-gradient(135deg, var(--secondary) 0%, #2a4a7f 100%);
    color: #fff;
    text-align: center;
    padding: 4rem 1.25rem;
}

.cta-section h2 { font-size: 1.75rem; font-weight: 800; margin-bottom: .75rem; }
.cta-section p  { opacity: .88; margin-bottom: 1.75rem; max-width: 500px; margin-left: auto; margin-right: auto; }

/* ===== FEATURES SECTION ===== */
.section { padding: 4rem 1rem; }
.section-title {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: .5rem;
}
.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.feature-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--secondary); margin-bottom: .5rem; }
.feature-card p  { font-size: .9rem; color: var(--text-muted); }

/* ===== STEPS ===== */
.steps { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; max-width: 900px; margin: 0 auto; }
.step { flex: 1; min-width: 200px; text-align: center; }
.step-num {
    width: 48px; height: 48px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; font-weight: 800;
    margin: 0 auto .75rem;
}
.step h3 { font-size: 1rem; font-weight: 700; color: var(--secondary); margin-bottom: .25rem; }
.step p  { font-size: .875rem; color: var(--text-muted); }

/* ===== DIVIDER ===== */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ===== FOOTER ===== */
.footer {
    background: var(--secondary);
    color: rgba(255,255,255,.85);
    padding: 2.5rem 1.25rem;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: .75rem;
}

/* Logo footer — fundal alb pentru vizibilitate */
.footer-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    background: #ffffff;
    padding: 3px;
    flex-shrink: 0;
}

.footer-copy { font-size: .85rem; margin-bottom: .25rem; opacity: .8; }
.footer-tagline { font-size: .8rem; opacity: .5; }

/* ===== POPUP MAPLIBRE ===== */
.maplibregl-popup-content {
    border-radius: var(--radius) !important;
    padding: 1rem !important;
    box-shadow: var(--shadow-lg) !important;
    min-width: 220px;
}

.popup-title { font-weight: 700; color: var(--secondary); font-size: 1rem; margin-bottom: .25rem; }
.popup-addr  { font-size: .82rem; color: var(--text-muted); margin-bottom: .25rem; }
.popup-phone a { font-size: .9rem; color: var(--primary); font-weight: 600; }
.popup-rating { margin: .4rem 0; }
.popup-actions { margin-top: .75rem; display: flex; gap: .5rem; flex-wrap: wrap; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-toggle { display: flex; }

    .nav-menu {
        display: none;
        position: absolute;
        top: 66px;
        left: 0;
        right: 0;
        background: #ffffff;
        flex-direction: column;
        align-items: stretch;
        padding: .5rem .75rem 1rem;
        box-shadow: 0 8px 24px rgba(29,53,87,.12);
        gap: .1rem;
        border-top: 1px solid var(--border);
    }

    .nav-menu.open { display: flex; }

    .nav-menu li a {
        padding: .7rem .75rem;
        border-radius: var(--radius-sm);
    }

    .map-container { height: 320px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .hero { padding: 3.5rem 1.25rem; }
    .section { padding: 2.5rem 1rem; }
    .auth-card { padding: 1.5rem; }
    .hero-logo { width: 72px; height: 72px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .radio-group { flex-direction: column; }
    .radio-card { min-width: unset; }
    .hero h1 { font-size: 1.6rem; }
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.w-100 { width: 100%; }
