/* ===== Hofflohmarkt Brand Tokens ===== */
:root {
    --hm-green: #7AB648;
    --hm-yellow: #F5D000;
    --hm-blue: #00A3D9;
    --hm-dark: #2D2D2D;
    --hm-light-bg: #F7F9FC;
    --hm-radius: 12px;
    --hm-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
}

/* ===== Registration Form ===== */
.hm-registration-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.hm-form-group {
    margin-bottom: 15px;
}

.hm-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.hm-form-group input[type="text"],
.hm-form-group input[type="email"],
.hm-form-group input[type="number"],
.hm-form-group select,
.hm-form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* ===== Flohmarkt-Hub Popup Variante ===== */
.hm-popup--area .hm-popup-header {
    border-top: 3px solid var(--hm-green);
}
.hm-popup-badge--area {
    background: var(--hm-green);
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}
.hm-popup--area .hm-popup-category::before {
    background: var(--hm-green);
}
.hm-popup--area .hm-popup-category strong {
    color: var(--hm-green);
    margin-left: 4px;
}

.hm-form-row {
    display: flex;
    gap: 12px;
}

.hm-form-row .hm-form-group {
    margin-bottom: 15px;
}

.hm-col-50 { flex: 0 0 calc(50% - 6px); min-width: 0; }
.hm-col-80 { flex: 0 0 calc(80% - 6px); min-width: 0; }
.hm-col-20 { flex: 0 0 calc(20% - 6px); min-width: 0; }

/* ===== Success Message ===== */
.hm-success-message {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 16px;
    background: #f0f9e8;
    border: 1.5px solid var(--hm-green);
    border-radius: var(--hm-radius);
    color: #3a6e1a;
    font-weight: 500;
}
.hm-success-message svg {
    flex-shrink: 0;
    color: var(--hm-green);
}

/* ===== Error Message ===== */
.hm-error-message {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1.5px solid #fecaca;
    border-radius: var(--hm-radius);
    color: #b91c1c;
    font-weight: 500;
}
.hm-error-message svg {
    flex-shrink: 0;
    color: #b91c1c;
}

/* ===== Map Wrapper ===== */
.hm-map-wrapper {
    position: relative;
    border-radius: var(--hm-radius);
    overflow: hidden;
    box-shadow: var(--hm-shadow);
    border: 1px solid #e0e0e0;
    margin: 20px 0;
}

#hm-map {
    height: 550px;
    width: 100%;
    z-index: 1;
}

/* ===== SVG Marker Reset ===== */
.hm-svg-marker {
    background: none !important;
    border: none !important;
}

/* ===== Map Legend ===== */
.hm-map-legend {
    position: absolute;
    bottom: 24px;
    left: 24px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 14px 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.06);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.4;
}

.hm-legend-title {
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 10px;
}

.hm-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    color: var(--hm-dark);
}

.hm-legend-item:last-child {
    margin-bottom: 0;
}

.hm-legend-marker {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.hm-legend-marker--blue {
    background-color: var(--hm-blue);
}

.hm-legend-marker--yellow {
    background-color: var(--hm-yellow);
}

.hm-legend-marker--green {
    background-color: var(--hm-green);
}

/* ===== Leaflet Popup Overrides ===== */
.leaflet-popup-content-wrapper {
    border-radius: 10px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12) !important;
    padding: 0 !important;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--hm-dark);
    min-width: 220px;
}

.leaflet-popup-tip {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12) !important;
}

/* ===== Popup Content ===== */
.hm-popup {
    padding: 0;
}

.hm-popup-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px 10px;
    border-bottom: 1px solid #f0f0f0;
}

/* Farbiger Top-Akzent je nach Typ */
.hm-popup--stand .hm-popup-header {
    border-top: 3px solid var(--hm-blue);
}

.hm-popup--nest .hm-popup-header {
    border-top: 3px solid var(--hm-yellow);
}

.hm-popup--space .hm-popup-header {
    border-top: 3px solid var(--hm-green);
}

.hm-popup-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 4px 10px;
    border-radius: 6px;
    color: white;
}

.hm-popup-badge svg {
    flex-shrink: 0;
}

.hm-popup-badge--nest {
    background-color: var(--hm-yellow);
    color: var(--hm-dark);
}

.hm-popup-badge--space {
    background-color: var(--hm-green);
}

.hm-popup-badge--stand {
    background-color: var(--hm-blue);
}

.hm-popup-address {
    font-weight: 700;
    color: var(--hm-blue);
    padding: 12px 18px 0;
    margin-bottom: 12px;
}

.hm-popup-detail {
    color: #666;
    font-size: 13px;
    padding: 0 18px;
    margin-bottom: 4px;
}

/* ===== Nest-Info Block ===== */
.hm-popup-nest-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 18px 0;
    padding: 8px 12px;
    background: #fef9e7;
    border: 1px solid #f5e6a3;
    border-left: 3px solid var(--hm-yellow);
    border-radius: 6px;
    font-size: 13px;
    color: var(--hm-dark);
}

.hm-popup-nest-info svg {
    flex-shrink: 0;
    color: #b8960c;
}

/* ===== Kategorien ===== */
.hm-popup-categories {
    margin: 10px 18px 14px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.hm-popup-categories-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #999;
    margin-bottom: 6px;
}

.hm-popup-categories-label svg {
    color: #bbb;
}

.hm-popup-categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hm-popup-category {
    font-size: 13px;
    color: var(--hm-dark);
    padding: 3px 0 3px 14px;
    position: relative;
}

.hm-popup-category::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--hm-blue);
}

.hm-popup--nest .hm-popup-category::before {
    background-color: var(--hm-yellow);
}

.hm-popup--space .hm-popup-category::before {
    background-color: var(--hm-green);
}

/* ===== Platz-Info ===== */
.hm-popup-spots {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 18px 0;
    padding: 6px 10px;
    background: #f0faf0;
    border-radius: 6px;
    font-size: 13px;
    color: var(--hm-dark);
}

.hm-popup-spots strong {
    color: var(--hm-green);
}

/* ===== Bewerben-Button ===== */
.hm-bewerbung-btn {
    margin: 10px 18px 14px;
}

/* ===== Submit Button Spinner ===== */
@keyframes hm-spin {
    to { transform: rotate(360deg); }
}

.hm-btn-spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: hm-spin 0.65s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

.hm-btn-loading {
    opacity: 0.72;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    #hm-map {
        height: 400px;
    }

    .hm-map-legend {
        bottom: 12px;
        left: 12px;
        padding: 10px 14px;
        font-size: 12px;
    }
}
