:root {
    --primary: #7a5230;
    /* Marrón cálido de las etiquetas del mapa */
    --primary-light: #9a6d45;
    --primary-dark: #5a2f14;
    /* Marrón oscuro de las ciudades */
    --accent: #d2b48c;
    /* Tan de las carreteras */
    --accent-soft: #f6efe6;
    /* Crema de los bordes de texto */
    --bg: #e9dfcf;
    /* Tono de la tierra del mapa */
    --surface: #ffffff;
    --text: #2c1e14;
    --text-muted: #7d5735;
    --error: #c0392b;
    --success: #5f7d8c;
    /* Azul pizarra del agua */
    --border: #d8cbb8;
    --border-strong: #c19a6b;
    --radius: 24px;
    --radius-sm: 12px;
    --shadow: 0 10px 30px -5px rgba(122, 82, 48, 0.15);
    --shadow-lg: 0 25px 50px -12px rgba(122, 82, 48, 0.25);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-5px);
    }

    100% {
        transform: translateY(0px);
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('hedgehog_form_bg_pattern_1777502357764.png');
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    z-index: -1;
}

.app-container {
    max-width: 850px;
    margin: 40px auto;
    padding: 0 20px;
    position: relative;
}

/* Header */
.main-header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInUp 0.8s ease-out forwards;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo-img {
    width: 80px;
    height: auto;
    animation: float 4s ease-in-out infinite;
}

.main-header h1 {
    font-family: 'Fredoka', sans-serif;
    font-size: 3rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.2rem;
    max-width: 500px;
    margin: 0 auto;
}

/* Form Card */
.form-card {
    background: #ffffff;
    padding: 50px;
    border-radius: var(--radius);
    box-shadow: 0 30px 60px -12px rgba(125, 74, 34, 0.25), 0 18px 36px -18px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--border);
    animation: fadeInUp 1s ease-out forwards;
}

.form-section {
    margin-bottom: 50px;
    position: relative;
}

.section-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title i {
    font-size: 1.2rem;
    color: var(--accent);
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text);
    font-size: 0.95rem;
    padding-left: 2px;
}

.field-help {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-style: italic;
}

/* Inputs & Icons */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 16px;
    color: var(--accent);
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.3s ease;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 14px 16px 14px 45px;
    border: none;
    border-bottom: 2px solid var(--border);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--accent-soft);
    color: var(--text);
}

.input-with-icon input:focus+i,
.input-with-icon input:not(:placeholder-shown)+i {
    color: var(--primary);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(125, 74, 34, 0.05);
}

textarea {
    padding: 16px;
    border-radius: var(--radius-sm);
    resize: vertical;
}

/* Grids */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

@media (max-width: 650px) {

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .form-card {
        padding: 30px 20px;
    }
}

.radio-group {
    display: inline-flex;
    gap: 12px;
    margin-top: 5px;
}

.radio-btn {
    position: relative;
    cursor: pointer;
    min-width: 100px;
}

.radio-btn input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-btn span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 28px;
    border-radius: 100px;
    background-color: var(--accent-soft);
    border: 2px solid var(--border);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.radio-btn:hover span {
    background-color: #fff;
    border-color: var(--primary-light);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.radio-btn input:checked+span {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 6px 15px rgba(122, 82, 48, 0.3);
}

.radio-btn input:checked+span i {
    color: #fff;
}

.radio-btn input:focus-visible+span {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

/* Number Stepper */
.number-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--accent-soft);
    border-radius: 100px;
    padding: 6px;
    width: 180px;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.number-stepper input {
    background: none;
    border: none;
    text-align: center;
    padding: 0 !important; /* Override general input padding */
    font-weight: 700;
    width: 60px;
    color: var(--primary);
    font-size: 1.1rem;
    height: 38px;
    margin: 0;
}

/* Ocultar flechas nativas del input number */
.number-stepper input::-webkit-outer-spin-button,
.number-stepper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.number-stepper input[type=number] {
    -moz-appearance: textfield;
}

.number-stepper:focus-within {
    background: #fff;
    box-shadow: 0 0 0 2px var(--primary);
}

.stepper-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.stepper-btn:hover {
    background: var(--primary);
    color: #fff;
    transform: scale(1.1);
}

.stepper-btn:active {
    transform: scale(0.95);
}

/* Map */
#map-container {
    height: 380px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 4px solid #fff;
    box-shadow: var(--shadow);
    margin-bottom: 15px;
}

#map-picker {
    height: 100%;
    width: 100%;
}

/* Photos */
.photo-upload-container {
    margin-top: 15px;
}

.photo-dropzone {
    border: 3px dashed var(--accent);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background: var(--accent-soft);
    position: relative;
    overflow: hidden;
}

.photo-dropzone::after {
    content: '';
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    background-image: url('hedgehog_silhouette_icon_transparent.png');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.1;
    transform: rotate(-15deg);
}

.photo-dropzone:hover {
    border-color: var(--primary);
    background: #fff;
}

.photo-dropzone .icon {
    font-size: 2.5rem;
    color: var(--primary);
}

.photo-dropzone .text {
    font-weight: 600;
    color: var(--primary);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 25px;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 3px solid #fff;
    transition: transform 0.3s ease;
}

.preview-item:hover {
    transform: scale(1.05);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.3s ease;
}

.preview-item:hover img {
    filter: brightness(0.8);
}

.remove-photo {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(192, 57, 43, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.remove-photo:hover {
    background: #e74c3c;
    transform: scale(1.1);
}

/* Checkbox */
.consent-section {
    padding: 20px;
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    cursor: pointer;
    font-size: 0.95rem;
}

.checkbox-container input {
    margin-top: 5px;
    accent-color: var(--primary);
    width: 20px;
    height: 20px;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 22px;
    border-radius: 50px;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: 0 10px 20px -5px rgba(125, 74, 34, 0.3);
}

.submit-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -10px rgba(125, 74, 34, 0.4);
}

.submit-btn:active {
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 1.4rem;
}

/* Progress & Messages */
.progress-container {
    margin-bottom: 25px;
}

.progress-bar-bg {
    height: 12px;
    background: var(--accent-soft);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

.form-message {
    margin-top: 25px;
    padding: 20px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 600;
}

.form-message.success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.form-message.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.hidden {
    display: none !important;
}

/* Footer */
.app-footer {
    text-align: center;
    margin-top: 40px;
    padding-bottom: 40px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Selector de tipo de mapa personalizado (Diseño Premium) */
.map-type-pill {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    padding: 4px;
    margin: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-family: 'Public Sans', sans-serif;
    z-index: 10;
}

.map-type-pill button {
    background: transparent;
    border: none;
    padding: 6px 16px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: #46483c;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.map-type-pill button:hover:not(.active) {
    background: rgba(72, 84, 34, 0.08);
    color: #485422;
}

.map-type-pill button.active {
    background: #485422;
    color: white;
    box-shadow: 0 4px 12px rgba(72, 84, 34, 0.35);
}