/* Inmobiliar.ia — estilos globales. Paleta tomada del logo. */
:root {
    --navy: #2b3a52;
    --navy-soft: #39465a;
    --teal: #069dae;
    --green: #50c078;
    --mint: #2cb285;
    --grad: linear-gradient(135deg, #069dae 0%, #2cb285 55%, #50c078 100%);
    --bg: #f4f9f9;
    --card: #ffffff;
    --line: #dfe8ea;
    --muted: #6b7a8c;
    --danger: #c0392b;
    --radius: 12px;
    --shadow: 0 2px 10px rgba(43, 58, 82, .08);
    --shadow-lg: 0 8px 28px rgba(43, 58, 82, .14);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--navy-soft);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--navy); line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; margin-top: 1.6em; }
h3 { font-size: 1.1rem; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
p { margin: 0 0 1em; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
main.container { padding-top: 28px; padding-bottom: 56px; min-height: 60vh; }
.muted { color: var(--muted); }

/* ---------- Cabecera ---------- */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 50;
    box-shadow: 0 1px 6px rgba(43, 58, 82, .05);
}
.site-header .container { display: flex; align-items: center; gap: 22px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 800; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand img.wordmark { height: 30px; width: auto; display: block; }
.brand img.mark { height: 36px; width: 36px; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a {
    color: var(--navy-soft); font-weight: 600; font-size: .95rem;
    padding: 8px 12px; border-radius: 8px;
}
.nav a:hover { background: var(--bg); text-decoration: none; color: var(--teal); }
.nav a.active { color: var(--teal); background: #e6f6f4; }
.nav-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-right form { margin: 0; }

/* ---------- Botones ---------- */
button, .btn {
    display: inline-block;
    font: inherit; font-weight: 700; font-size: .93rem;
    padding: 9px 18px; border: 0; border-radius: 9px; cursor: pointer;
    color: #fff; background: var(--grad);
    box-shadow: 0 2px 6px rgba(6, 157, 174, .28);
    transition: transform .08s ease, box-shadow .15s ease, filter .15s ease;
}
button:hover, .btn:hover { filter: brightness(1.06); box-shadow: 0 4px 12px rgba(6, 157, 174, .35); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
.btn-outline, button.btn-outline {
    background: #fff; color: var(--teal); box-shadow: none; border: 1.5px solid var(--teal);
}
.btn-outline:hover { background: #e6f6f4; box-shadow: none; }
.btn-ghost, button.btn-ghost { background: transparent; color: var(--navy-soft); box-shadow: none; border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bg); box-shadow: none; }
.btn-danger, button.btn-danger { background: #fff; color: var(--danger); box-shadow: none; border: 1.5px solid #e9b8b2; }
.btn-danger:hover { background: #fdf0ee; box-shadow: none; }
.btn-lg { padding: 13px 28px; font-size: 1.02rem; }
.btn-sm, button.btn-sm { padding: 5px 12px; font-size: .84rem; }

/* ---------- Formularios ---------- */
input[type=text], input[type=email], input[type=password], input[type=number], input[type=file], select, textarea {
    font: inherit; color: var(--navy);
    padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 9px; background: #fff;
    max-width: 100%;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(6, 157, 174, .16);
}
label { font-weight: 600; font-size: .9rem; color: var(--navy); }
textarea { width: 100%; max-width: 640px; }
form.stack label { display: block; margin-bottom: 14px; }
form.stack input, form.stack select { width: 100%; margin-top: 5px; }
form.stack button { width: 100%; padding: 12px; margin-top: 4px; }
.form-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); max-width: 820px; }
.form-panel p { margin-bottom: 16px; }
.form-panel label input, .form-panel label select { margin-top: 4px; }

/* ---------- Tarjetas / grilla de propiedades ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; margin: 18px 0 30px; }
.prop-card {
    background: var(--card); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); border: 1px solid var(--line);
    transition: transform .15s ease, box-shadow .15s ease; display: flex; flex-direction: column;
}
.prop-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.prop-card a { color: inherit; display: block; }
.prop-card a:hover { text-decoration: none; }
.prop-card .cover { aspect-ratio: 4 / 3; background: #e8f3f3; position: relative; overflow: hidden; }
.prop-card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prop-card .cover .noimg { display: flex; align-items: center; justify-content: center; height: 100%; color: #9bb5b8; font-size: .9rem; }
.prop-card .op {
    position: absolute; top: 10px; left: 10px; background: var(--navy); color: #fff;
    font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; letter-spacing: .03em; text-transform: uppercase;
}
.prop-card .op.rent { background: var(--teal); }
.prop-card .body { padding: 14px 16px 16px; }
.prop-card .title { font-weight: 700; color: var(--navy); font-size: 1.02rem; margin-bottom: 4px; }
.prop-card .price { font-size: 1.2rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.prop-card .meta { color: var(--muted); font-size: .88rem; margin-top: 4px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; background: var(--card); padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.filters input, .filters select { flex: 1 1 140px; }

/* ---------- Detalle de propiedad ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 16px 0 24px; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.detail-price { font-size: 1.7rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.facts { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 12px 0 20px; }
.facts li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: .92rem; }
.facts li span { display: block; font-weight: 500; color: var(--muted); font-size: .76rem; }

/* ---------- Tablas ---------- */
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
th { text-align: left; background: #eef6f6; color: var(--navy); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td form { margin: 0; }
.table-wrap { overflow-x: auto; }

/* ---------- Avisos ---------- */
.flash, .status {
    background: #e6f6f4; border: 1px solid #b6e3dd; color: #0b6b62;
    padding: 12px 16px; border-radius: 10px; margin: 0 0 18px; font-weight: 600;
}
.error { background: #fdf0ee; border: 1px solid #f0c4be; color: var(--danger); padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; }
ul.error { list-style: none; }
ul.error li + li { margin-top: 4px; }
.alert { background: #fff6e0; border: 1px solid #f1d78a; color: #7a5a00; padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; }
.alert-danger { background: #fdf0ee; border: 1px solid #f0c4be; color: var(--danger); }
.badge { display: inline-block; font-size: .76rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; background: #e6f6f4; color: var(--mint); }
.badge.reserved { background: #fff6e0; color: #b07d00; }
.badge.sold, .badge.rented { background: #eceff3; color: var(--muted); }
.badge.rejected { background: #fdf0ee; color: var(--danger); }
.badge.pending_review, .badge.pending_payment { background: #fff6e0; color: #b07d00; }

/* ---------- Planes ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; margin-top: 12px; }
.plan-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.plan-card h3 { font-size: 1.25rem; }
.plan-card form { display: inline-block; margin: 6px 6px 0 0; }
.payment-row { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.payment-row form { margin: 0; display: inline-flex !important; gap: 6px; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 66vh; display: flex; align-items: center; justify-content: center; padding: 10px 0; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 34px 32px; width: 100%; max-width: 440px; }
.auth-card .logo { text-align: center; margin-bottom: 16px; }
.auth-card .logo img { height: 72px; width: auto; }
.auth-card h1 { text-align: center; font-size: 1.5rem; }
.auth-card .sub { text-align: center; color: var(--muted); margin-bottom: 22px; }
.auth-card .below { text-align: center; margin-top: 18px; font-size: .92rem; }

/* ---------- Landing de plataforma ---------- */
.hero { background: var(--grad); color: #fff; }
.hero .container { display: grid; grid-template-columns: 1.1fr .9fr; gap: 30px; align-items: center; padding-top: 56px; padding-bottom: 56px; }
.hero h1 { color: #fff; font-size: 2.6rem; }
.hero p.lead { font-size: 1.15rem; opacity: .95; max-width: 520px; }
.hero .art { background: rgba(255, 255, 255, .95); border-radius: 22px; padding: 26px; text-align: center; box-shadow: var(--shadow-lg); }
.hero .art img { max-height: 240px; width: auto; }
.hero .btn { background: #fff; color: var(--teal); box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.hero .btn-outline { background: transparent; color: #fff; border-color: #fff; }
.hero .btn-outline:hover { background: rgba(255, 255, 255, .15); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin: 44px 0 10px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.feature .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 12px; }
.agency-hero { background: var(--grad); color: #fff; padding: 38px 0; }
.agency-hero h1 { color: #fff; font-size: 2.2rem; margin: 0 0 6px; }
.agency-hero p { margin: 0; opacity: .95; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.section-head h2 { margin: 0; }
.empty { text-align: center; padding: 42px 20px; background: var(--card); border: 1px dashed #b9d3d5; border-radius: var(--radius); color: var(--muted); }

/* ---------- Pie ---------- */
.site-footer { border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: .9rem; }
.site-footer .container { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; }
.site-footer img { height: 22px; width: auto; vertical-align: middle; opacity: .9; }

/* ---------- Chat flotante ---------- */
.chat-launcher {
    position: fixed; right: 20px; bottom: 20px; z-index: 90;
    width: 62px; height: 62px; border-radius: 50%; padding: 0; border: 3px solid #fff;
    background: #fff; box-shadow: var(--shadow-lg); cursor: pointer; overflow: hidden;
}
.chat-launcher img { width: 100%; height: 100%; object-fit: contain; padding: 4px; display: block; }
.chat-box {
    position: fixed; right: 20px; bottom: 96px; z-index: 90;
    width: 350px; max-width: calc(100vw - 32px); height: 470px; max-height: calc(100vh - 130px);
    background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--line);
    display: none; flex-direction: column; overflow: hidden;
}
.chat-box.open { display: flex; }
.chat-head { background: var(--grad); color: #fff; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; }
.chat-head strong { font-size: 1rem; }
.chat-head small { display: block; opacity: .9; font-weight: 400; }
.chat-head button { background: transparent; box-shadow: none; padding: 2px 8px; font-size: 1.3rem; line-height: 1; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; background: #f7fbfb; }
.chat-msg { margin: 8px 0; display: flex; }
.chat-msg span { max-width: 84%; padding: 8px 13px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; font-size: .93rem; }
.chat-msg.bot span { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--navy); }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.user span { background: var(--grad); color: #fff; border-bottom-right-radius: 4px; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: #fff; }
.chat-form input { flex: 1; min-width: 0; }
.chat-form button { padding: 9px 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
    h1 { font-size: 1.6rem; }
    .hero .container { grid-template-columns: 1fr; padding-top: 34px; padding-bottom: 34px; }
    .hero h1 { font-size: 2rem; }
    .hero .art { order: -1; }
    .site-header .container { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
    .nav { order: 3; flex-basis: 100%; }
    .filters input, .filters select { flex-basis: 45%; }
    .chat-box { right: 8px; bottom: 90px; }
    .chat-launcher { right: 12px; bottom: 12px; }
}

/* ---------- Barra de uso del plan ---------- */
.meter { height: 10px; background: #e3eeee; border-radius: 10px; overflow: hidden; margin-top: 8px; }
.meter-fill { height: 100%; background: var(--grad); border-radius: 10px; transition: width .3s; }
.meter-fill.full { background: linear-gradient(90deg, #e59a2f, #c0392b); }
body { overflow-x: hidden; }
