/* ==========================================================================
   URBENORTE — Página Valorar mi Piso
   ========================================================================== */

/* ══ Hero ════════════════════════════════════════════════════════════════ */

.page-hero--valoracion {
    background:
        linear-gradient(to bottom, rgba(10,30,30,0.6) 0%, rgba(10,30,30,0.8) 100%),
        url('../../img/Hero_Urbenorte.png') center 30% / cover no-repeat;
}

/* ══ Layout principal ════════════════════════════════════════════════════ */

.valoracion-section {
    background: var(--c-bg);
    padding: var(--sp-16) 0 var(--sp-20);
}

.valoracion-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: var(--sp-10);
    align-items: start;
}

@media (max-width: 1024px) {
    .valoracion-layout {
        grid-template-columns: 1fr;
    }
    .valoracion__sidebar {
        order: -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--sp-4);
    }
}

@media (max-width: 640px) {
    .valoracion__sidebar {
        grid-template-columns: 1fr;
    }
}

/* ══ Formulario principal ════════════════════════════════════════════════ */

.val-form {
    background: var(--c-bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    /* overflow: visible para que el dropdown del autocompletado
       no quede recortado por la combinación border-radius + overflow.
       Los bordes redondeados de la barra de progreso y pasos se
       gestionan en sus propios elementos. */
    overflow: visible;
    position: relative;
}

/* Progress bar */
.val-form__progress {
    height: 4px;
    background: var(--c-border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    overflow: hidden;
}

.val-form__progress-bar {
    height: 100%;
    background: var(--c-accent);
    transition: width 400ms ease;
}

/* Steps breadcrumb */
.val-form__steps {
    display: flex;
    align-items: center;
    padding: var(--sp-5) var(--sp-8);
    border-bottom: 1px solid var(--c-border);
    background: var(--c-bg);
    gap: 0;
}

.val-form__step {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--c-text-muted);
    background: none;
    border: none;
    cursor: default;
    padding: 0;
    white-space: nowrap;
}

.val-form__step.is-active {
    color: var(--c-primary);
    cursor: pointer;
}

.val-form__step.is-done {
    color: var(--c-success);
    cursor: pointer;
}

.val-form__step-num {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-full);
    border: 2px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-xs);
    font-weight: 700;
    flex-shrink: 0;
    transition: all var(--transition);
}

.val-form__step.is-active .val-form__step-num {
    border-color: var(--c-primary);
    background: var(--c-primary);
    color: #fff;
}

.val-form__step.is-done .val-form__step-num {
    border-color: var(--c-success);
    background: var(--c-success);
    color: #fff;
}

.val-form__step-label {
    display: none;
}

@media (min-width: 480px) {
    .val-form__step-label { display: inline; }
}

.val-form__step-line {
    flex: 1;
    height: 1px;
    background: var(--c-border);
    margin: 0 var(--sp-3);
}

/* Panel */
.val-form__panel {
    padding: var(--sp-8) var(--sp-8) var(--sp-10);
}

@media (max-width: 640px) {
    .val-form__panel { padding: var(--sp-6) var(--sp-5); }
}

.val-form__panel-title {
    font-family: var(--font-display);
    font-size: var(--fs-2xl);
    font-weight: 700;
    color: var(--c-primary-dark);
    margin-bottom: var(--sp-6);
    line-height: 1.2;
}

.val-form__panel-subtitle {
    font-size: var(--fs-md);
    color: var(--c-text-light);
    margin-top: calc(-1 * var(--sp-4));
    margin-bottom: var(--sp-6);
}

/* Field groups */
.val-form__field-group {
    margin-bottom: var(--sp-5);
}

.val-form__label {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--c-text);
    margin-bottom: var(--sp-2);
}

.val-form__label .required {
    color: var(--c-accent);
}

.val-form__label .optional {
    font-weight: 400;
    color: var(--c-text-muted);
    font-style: normal;
    font-size: var(--fs-xs);
    margin-left: var(--sp-1);
}

.val-form__input,
.val-form__select {
    width: 100%;
    padding: 11px var(--sp-4);
    font-size: var(--fs-base);
    font-family: var(--font-body);
    color: var(--c-text);
    background: #fff;
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

.val-form__select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B6B6B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.val-form__input:focus,
.val-form__select:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(27,96,96,0.1);
}

.val-form__hint {
    font-size: var(--fs-xs);
    color: var(--c-text-muted);
    margin-top: var(--sp-1);
}

.val-form__error {
    font-size: var(--fs-xs);
    color: var(--c-error);
    margin-top: var(--sp-1);
}

/* 2-col grid */
.val-form__grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-4);
}

@media (max-width: 480px) {
    .val-form__grid-2 { grid-template-columns: 1fr; }
}

/* Radio cards — tipo de inmueble */
.val-form__radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--sp-3);
}

.val-form__radio-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-4) var(--sp-3);
    border: 2px solid var(--c-border);
    border-radius: var(--radius-lg);
    background: #fff;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), transform var(--transition);
    text-align: center;
    font-size: var(--fs-sm);
    color: var(--c-text-light);
    font-weight: 500;
}

.val-form__radio-card:hover {
    border-color: var(--c-primary-light);
    background: rgba(27,96,96,0.04);
    transform: translateY(-1px);
}

.val-form__radio-card.is-selected {
    border-color: var(--c-primary);
    background: rgba(27,96,96,0.08);
    color: var(--c-primary-dark);
}

.val-form__radio-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.val-form__radio-label {
    font-size: var(--fs-xs);
    font-weight: 600;
}

/* Radio tabs — Vender / Alquilar */
.val-form__radio-tabs {
    display: flex;
    gap: 0;
    border-radius: var(--radius);
    border: 2px solid var(--c-border);
    overflow: hidden;
    width: fit-content;
}

.val-form__radio-tab {
    padding: var(--sp-3) var(--sp-8);
    font-size: var(--fs-base);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    color: var(--c-text-muted);
}

.val-form__radio-tab + .val-form__radio-tab {
    border-left: 2px solid var(--c-border);
}

.val-form__radio-tab.is-selected {
    background: var(--c-primary);
    color: #fff;
}

/* Checkbox cards */
.val-form__checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--sp-3);
}

.val-form__checkbox-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-1);
    padding: var(--sp-3) var(--sp-2);
    border: 2px solid var(--c-border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--c-text-light);
    transition: border-color var(--transition), background var(--transition);
    text-align: center;
}

.val-form__checkbox-card.is-checked {
    border-color: var(--c-accent);
    background: rgba(232,82,26,0.06);
    color: var(--c-accent-dark);
}

.val-form__cb-icon {
    font-size: 1.4rem;
}

/* RGPD */
.val-form__rgpd {
    margin-bottom: var(--sp-5);
}

.val-form__rgpd-label {
    display: flex;
    gap: var(--sp-3);
    font-size: var(--fs-sm);
    color: var(--c-text-light);
    cursor: pointer;
    align-items: flex-start;
    line-height: 1.5;
}

.val-form__rgpd-label a {
    color: var(--c-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.val-form__rgpd-label input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--c-primary);
    width: 16px;
    height: 16px;
}

/* Actions */
.val-form__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--sp-6);
    padding-top: var(--sp-6);
    border-top: 1px solid var(--c-border);
}

.val-form__actions--between {
    justify-content: space-between;
}

/* ══ Pantalla de resultado ═══════════════════════════════════════════════ */

.val-result {
    background: var(--c-bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: var(--sp-10) var(--sp-8);
}

.val-result__header {
    text-align: center;
    margin-bottom: var(--sp-8);
    padding-bottom: var(--sp-8);
    border-bottom: 1px solid var(--c-border);
}

.val-result__icon {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    background: rgba(74,139,92,0.1);
    color: var(--c-success);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--sp-4);
}

.val-result__title {
    font-family: var(--font-display);
    font-size: var(--fs-3xl);
    color: var(--c-primary-dark);
    margin-bottom: var(--sp-3);
}

.val-result__sub {
    font-size: var(--fs-md);
    color: var(--c-text-light);
}

/* Estimación */
.val-result__estimacion {
    background: var(--c-primary-dark);
    border-radius: var(--radius-lg);
    padding: var(--sp-8) var(--sp-6);
    text-align: center;
    margin-bottom: var(--sp-6);
    color: #fff;
}

.val-result__est-label {
    font-size: var(--fs-xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.65);
    margin-bottom: var(--sp-2);
}

.val-result__est-central {
    font-size: var(--fs-4xl);
    font-weight: 700;
    color: #fff;
    font-family: var(--font-display);
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: var(--sp-3);
}

.val-result__est-range {
    font-size: var(--fs-sm);
    color: rgba(255,255,255,0.7);
}

.val-result__est-range strong {
    color: #fff;
}

.val-result__range-bar {
    position: relative;
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-full);
    margin: var(--sp-4) auto 0;
    width: 70%;
    overflow: hidden;
}

.val-result__range-fill {
    position: absolute;
    left: 10%;
    width: 80%;
    height: 100%;
    background: var(--c-accent);
    border-radius: var(--radius-full);
}

.val-result__range-marker {
    position: absolute;
    left: 50%;
    width: 3px;
    height: 100%;
    background: #fff;
    margin-left: -1px;
}

.val-result__disclaimer {
    font-size: var(--fs-xs);
    color: var(--c-text-muted);
    line-height: 1.6;
    padding: var(--sp-4) var(--sp-5);
    background: var(--c-bg);
    border-radius: var(--radius);
    border-left: 3px solid var(--c-border-dark);
    margin-bottom: var(--sp-8);
}

.val-result__actions {
    display: flex;
    gap: var(--sp-4);
    flex-wrap: wrap;
    justify-content: center;
}

/* ══ Sidebar ══════════════════════════════════════════════════════════════ */

.valoracion__sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

.val-sidebar__card {
    background: var(--c-bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: var(--sp-6);
}

.val-sidebar__card--teal {
    background: var(--c-primary-dark);
}

.val-sidebar__card--light {
    background: var(--c-bg);
    box-shadow: none;
    border: 1px solid var(--c-border);
}

.val-sidebar__title {
    font-family: var(--font-display);
    font-size: var(--fs-xl);
    font-weight: 700;
    color: var(--c-primary-dark);
    margin-bottom: var(--sp-5);
}

.val-sidebar__title--light {
    color: #fff;
}

/* Pasos explicativos */
.val-sidebar__steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-5);
}

.val-sidebar__steps li {
    display: flex;
    gap: var(--sp-4);
    align-items: flex-start;
}

.val-sidebar__num {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--c-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-xs);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.val-sidebar__steps strong {
    display: block;
    font-size: var(--fs-sm);
    color: var(--c-text);
    margin-bottom: 2px;
}

.val-sidebar__steps p {
    font-size: var(--fs-xs);
    color: var(--c-text-muted);
    line-height: 1.5;
    margin: 0;
}

/* Oficinas */
.val-sidebar__offices {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

.val-sidebar__offices li {
    font-size: var(--fs-sm);
}

.val-sidebar__offices strong {
    display: block;
    color: rgba(255,255,255,0.7);
    font-size: var(--fs-xs);
    font-weight: 500;
    margin-bottom: 2px;
}

.val-sidebar__offices a {
    color: #fff;
    font-weight: 700;
    font-size: var(--fs-md);
    text-decoration: none;
    transition: color var(--transition);
}

.val-sidebar__offices a:hover {
    color: var(--c-accent-light);
}

/* Trust badge */
.val-sidebar__trust {
    display: flex;
    gap: var(--sp-4);
    align-items: flex-start;
}

.val-sidebar__trust-icon {
    flex-shrink: 0;
    color: var(--c-primary);
    margin-top: 2px;
}

.val-sidebar__trust strong {
    display: block;
    font-size: var(--fs-sm);
    color: var(--c-text);
    margin-bottom: 3px;
}

.val-sidebar__trust p {
    font-size: var(--fs-xs);
    color: var(--c-text-muted);
    line-height: 1.5;
    margin: 0;
}

/* ══ Live Estimation (Paso 2) ═════════════════════════════════════════════ */

.val-form__live-estimate {
    margin-top: var(--sp-6);
    padding-top: var(--sp-5);
    border-top: 2px dashed var(--c-border);
}

.val-form__live-estimate-inner {
    background: linear-gradient(135deg, #f0f7ed 0%, #e8f0e4 100%);
    border: 1px solid rgba(74, 90, 60, 0.15);
    border-radius: var(--radius-lg);
    padding: var(--sp-5) var(--sp-6);
    text-align: center;
}

.val-form__live-estimate-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--c-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--sp-2);
}

.val-form__live-estimate-header svg {
    color: var(--c-primary);
}

.val-form__live-estimate-value {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--c-text);
    line-height: 1.2;
    margin-bottom: var(--sp-1);
}

.val-form__live-estimate-range {
    font-size: var(--fs-sm);
    color: var(--c-text-light);
    font-weight: 500;
}

.val-form__live-estimate-note {
    font-size: var(--fs-xs);
    color: var(--c-text-muted);
    margin: var(--sp-3) 0 0;
    line-height: 1.5;
}

/* ══ Summary (Paso 3) ════════════════════════════════════════════════════ */

.val-form__summary {
    background: linear-gradient(135deg, #f0f7ed 0%, #e8f0e4 100%);
    border: 1px solid rgba(74, 90, 60, 0.15);
    border-radius: var(--radius-lg);
    padding: var(--sp-5) var(--sp-6);
    text-align: center;
    margin-bottom: var(--sp-6);
}

.val-form__summary-label {
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--c-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--sp-2);
}

.val-form__summary-value {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 700;
    color: var(--c-text);
    line-height: 1.2;
    margin-bottom: var(--sp-1);
}

.val-form__summary-range {
    font-size: var(--fs-sm);
    color: var(--c-text-light);
    font-weight: 500;
    margin-bottom: var(--sp-3);
}

.val-form__summary-note {
    font-size: var(--fs-xs);
    color: var(--c-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* ══ Zona hint ═══════════════════════════════════════════════════════════ */

.val-form__hint-inline {
    font-weight: 400;
    font-size: var(--fs-xs);
    color: var(--c-primary);
    font-style: normal;
    margin-left: var(--sp-2);
}

/* ══ Autocompletado de dirección (CartoCiudad) ═══════════════════════════ */

.val-form__autocomplete-wrap {
    position: relative;
}

.val-form__autocomplete {
    position: relative;
}

.val-form__autocomplete-check {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--c-primary);
    display: flex;
    align-items: center;
}

.val-form__autocomplete-spinner {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--c-text-light);
    animation: val-spin 1s linear infinite;
}

@keyframes val-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

.val-form__autocomplete-list {
    position: absolute;
    z-index: 50;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--c-bg-white);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    list-style: none;
    padding: var(--sp-1) 0;
    max-height: 280px;
    overflow-y: auto;
}

.val-form__autocomplete-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    cursor: pointer;
    transition: background 0.12s ease;
    font-size: var(--fs-sm);
    line-height: 1.4;
}

.val-form__autocomplete-item:hover,
.val-form__autocomplete-item.is-highlighted {
    background: rgba(74, 90, 60, 0.06);
}

.val-form__autocomplete-pin {
    flex-shrink: 0;
    color: var(--c-primary);
    opacity: 0.6;
}

.val-form__autocomplete-item span {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.val-form__autocomplete-item strong {
    font-weight: 600;
    color: var(--c-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.val-form__autocomplete-item small {
    font-size: var(--fs-xs);
    color: var(--c-text-light);
    margin-top: 1px;
}

/* Opción libre (municipio no en la lista) */
.val-form__autocomplete-item--libre {
    border-top: 1px solid var(--c-border);
    margin-top: var(--sp-1);
    padding-top: calc(var(--sp-3) + var(--sp-1));
    color: var(--c-text-light);
}

.val-form__autocomplete-item--libre strong {
    color: var(--c-text-light);
    font-weight: 500;
}

.val-form__autocomplete-item--libre svg {
    opacity: 0.5;
}

/* Hint con icono */
.val-form__hint .icon {
    vertical-align: -1px;
    margin-right: 2px;
    opacity: 0.5;
}

/* ══ Utility ══════════════════════════════════════════════════════════════ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
