/* ============================================================
   Geo-Immo — shared stylesheet
   ============================================================ */

/* --- Variables & reset ------------------------------------ */
:root {
  --navy:       #0f2d4a;
  --navy-light: #1a4268;
  --gold:       #c9a84c;
  --bg:         #f0f4f8;
  --white:      #ffffff;
  --text:       #1e293b;
  --muted:      #64748b;
  --border:     #e2e8f0;
  --green:      #16a34a;
  --green-bg:   #dcfce7;
  --amber:      #b45309;
  --amber-bg:   #fef3c7;
  --red:        #dc2626;
  --red-bg:     #fee2e2;
  --radius:     12px;
  --shadow:     0 4px 24px rgba(0,0,0,.08);
  --light:      #f8fafc;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg);
       color: var(--text); line-height: 1.5; }

/* --- Centered card pages (login / reset / buy) ------------ */
.page-centered {
  min-height: calc(100vh - 60px); display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, #1e4d7b 100%);
}
.card {
  background: var(--white); border-radius: var(--radius);
  padding: 2.8rem 2.4rem; box-shadow: 0 20px 60px rgba(0,0,0,.3);
  width: 100%; max-width: 380px;
}
.card-wide { max-width: 420px; }

/* --- Logo (card pages) ------------------------------------ */
.logo { text-align: center; margin-bottom: 2rem; }
.logo-mark { display: inline-flex; align-items: center; gap: .5rem;
             font-size: 1.6rem; font-weight: 700; color: var(--navy); }
.logo-mark span { color: var(--gold); }
.logo-sub { font-size: .8rem; color: var(--muted); margin-top: .2rem;
            letter-spacing: .08em; text-transform: uppercase; }

/* --- Forms ------------------------------------------------ */
label { display: block; font-size: .82rem; font-weight: 600;
        color: var(--muted); margin-bottom: .35rem; letter-spacing: .03em; }
.field { margin-bottom: 1.1rem; }
input {
  width: 100%; padding: .65rem 1rem; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: .95rem; font-family: inherit;
  transition: border-color .15s;
}
input:focus { outline: none; border-color: var(--gold);
              box-shadow: 0 0 0 3px rgba(201,168,76,.15); }
button {
  width: 100%; padding: .75rem; margin-top: .5rem;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: white; border: none; border-radius: 8px;
  font-size: .95rem; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: opacity .15s;
}
button:hover { opacity: .9; }

/* --- Messages --------------------------------------------- */
.msg-ok {
  background: var(--green-bg); border-left: 3px solid var(--green);
  border-radius: 6px; padding: .7rem .9rem; color: var(--green);
  font-size: .87rem; margin-bottom: 1.2rem;
}
.msg-err, .error {
  background: var(--red-bg); border-left: 3px solid var(--red);
  border-radius: 6px; padding: .7rem .9rem; color: var(--red);
  font-size: .87rem; margin-bottom: 1.2rem;
}
.success {
  background: var(--green-bg); border-left: 3px solid var(--green);
  border-radius: 6px; padding: .7rem .9rem; color: var(--green);
  font-size: .87rem; margin-bottom: 1.2rem;
}
.success a { color: var(--green); font-weight: 600; }
.auth-switch {
  text-align: center; margin-top: 1.4rem; font-size: .85rem; color: var(--muted);
}
.auth-switch a { color: var(--navy); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.back { display: block; text-align: center; margin-top: 1.2rem;
        font-size: .85rem; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--navy); }

/* --- Global header ---------------------------------------- */
.global-header, header {
  background: linear-gradient(135deg, #1e4d7b 0%, #2E7D9E 100%);
  color: white; padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; box-shadow: 0 2px 12px rgba(0,0,0,.2);
  position: sticky; top: 0; z-index: 100;
}
.header-logo { display: flex; align-items: center; }
.header-logo img { height: 64px; width: auto; margin-top: -8px; }
.header-logo span { color: var(--gold); }
.header-right { display: flex; align-items: center; gap: 1.2rem; }
.nav-btn, .logout-btn {
  font-size: .82rem; color: rgba(255,255,255,.75); text-decoration: none;
  border: 1px solid rgba(255,255,255,.25); border-radius: 6px;
  padding: .3rem .75rem; transition: all .15s;
}
.nav-btn:hover, .logout-btn:hover { background: rgba(255,255,255,.1); color: white; }
.credits-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(201,168,76,.15); border: 1px solid var(--gold);
  border-radius: 20px; padding: .3rem .9rem;
  color: var(--gold); font-size: .82rem; font-weight: 600; text-decoration: none;
}

/* --- Main layout ------------------------------------------ */
main { max-width: 1280px; margin: 2rem auto; padding: 0 1.5rem 3rem; }
main.main-centered {
  min-height: calc(100vh - 70px);
  display: flex; flex-direction: column; justify-content: center;
  padding-top: 0; padding-bottom: 0;
}

/* --- Search card (index) ---------------------------------- */
.search-card {
  background: var(--white); border-radius: var(--radius);
  padding: 1.8rem 2rem; box-shadow: var(--shadow); margin-bottom: 1.8rem;
  border-top: 3px solid var(--gold);
}
.search-tabs { display: flex; gap: .4rem; margin-bottom: 1.2rem; }
.search-tab {
  width: auto; margin: 0; padding: .4rem 1.1rem;
  font-size: .85rem; font-weight: 600;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 6px; color: var(--muted); cursor: pointer; transition: all .15s;
}
.search-tab.active {
  background: var(--navy); color: white; border-color: var(--navy); opacity: 1;
}
.search-tab:hover:not(.active) { border-color: var(--gold); color: var(--navy); opacity: 1; }
.tab-panel label { font-weight: 600; font-size: .9rem; }
.search-card label { font-weight: 600; font-size: .9rem; margin-bottom: .6rem; }
.input-row { display: flex; gap: .6rem; }
.input-row input {
  flex: 1; padding: .7rem 1rem; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: .95rem; font-family: inherit;
  transition: border-color .15s;
}
.input-row input:focus { outline: none; border-color: var(--gold);
                          box-shadow: 0 0 0 3px rgba(201,168,76,.15); }
.input-row button {
  padding: .7rem 1.6rem; white-space: nowrap; width: auto; margin-top: 0;
}
.input-row button:hover { opacity: .88; }
.loading { display: none; align-items: center; gap: .6rem;
           margin-top: .9rem; font-size: .88rem; color: var(--muted); }
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  -webkit-animation: spin .7s linear infinite;
          animation: spin .7s linear infinite;
  will-change: transform;
  flex-shrink: 0;
}
@-webkit-keyframes spin { to { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }
@keyframes spin          { to { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }

/* --- Info grid (index) ------------------------------------ */
.info-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; margin-bottom: 1.8rem;
}
.info-box {
  background: var(--white); border-radius: var(--radius);
  padding: 1.2rem 1.4rem; box-shadow: var(--shadow);
  border-bottom: 3px solid var(--gold);
}
.info-box .lbl { font-size: .72rem; font-weight: 600; color: var(--muted);
                 text-transform: uppercase; letter-spacing: .07em; }
.info-box .val { font-size: 1.2rem; font-weight: 700; color: var(--navy); margin-top: .3rem; }

/* --- Section / results (index) ---------------------------- */
.section {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 1.8rem; overflow: hidden;
}
.section-header {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: white; padding: 1rem 1.5rem;
  display: flex; align-items: center; gap: .6rem;
}
.section-header h2 { font-size: 1rem; font-weight: 600; flex: 1; }
/* --- Parcel image grid ------------------------------------ */
.parcels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1rem 1.5rem;
}
.parcel-hidden { display: none; }
.parcel-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,.08); overflow: hidden;
}
.parcels-grid .parcel-card:first-child {
  grid-column: 1 / -1;
}
.parcels-grid .parcel-card:first-child .parcel-map-embed {
  aspect-ratio: 16 / 7;
}
.parcel-map-embed {
  width: 100%; aspect-ratio: 1; border: none; display: block;
}
.parcel-card-body { padding: .5rem .6rem; }
.parcel-address { font-size: .8rem; font-weight: 600; color: var(--navy); margin-bottom: .3rem; }
.parcel-card-footer {
  display: flex; align-items: center; gap: .4rem; flex-wrap: nowrap;
}
.parcel-card-footer .parcel-meta {
  white-space: nowrap; font-size: .75rem; flex-shrink: 0;
}
.parcel-card-footer .gmaps-link {
  white-space: nowrap; font-size: .75rem; flex: 1; text-align: center;
}
.parcel-card-footer .btn-fav {
  padding: 0; margin: 0; font-size: 1rem; line-height: 1;
  background: none; border: none; cursor: pointer;
  align-self: center;
}
.parcel-card-header { display: flex; gap: .4rem; align-items: center; margin-bottom: .35rem; flex-wrap: wrap; }
.parcel-label { font-weight: 600; font-size: .88rem; line-height: 1.3; }
.parcel-meta { font-size: .78rem; color: var(--muted); }
.parcel-actions { margin-top: .5rem; }
.parcel-actions .gmaps-link { font-size: .78rem; white-space: nowrap; }
.show-more-btn {
  width: auto; margin: .8rem 0 0; padding: .4rem 1.1rem;
  font-size: .82rem; font-weight: 600;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 6px; color: var(--navy); cursor: pointer; transition: border-color .15s;
}
.show-more-btn:hover { border-color: var(--gold); background: #fffbf0; opacity: 1; }
.open-all-btn {
  width: auto; margin-top: 0; padding: .35rem .9rem;
  font-size: .78rem; font-weight: 600;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.4);
  border-radius: 6px; color: white; cursor: pointer; transition: background .15s;
}
.open-all-btn:hover { background: rgba(255,255,255,.28); opacity: 1; }
.section-body { padding: 1.5rem; }
.subsection-title {
  font-size: .88rem; font-weight: 700; color: var(--navy);
  margin: 1.4rem 0 .8rem; padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.subsection-title:first-child { margin-top: 0; }
.count-badge {
  background: var(--navy); color: white; font-size: .72rem;
  font-weight: 700; padding: .15rem .55rem; border-radius: 20px;
}

/* --- Tables ----------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead tr { background: #f8fafc; }
th { padding: .55rem .9rem; text-align: left; font-weight: 600;
     color: var(--muted); font-size: .78rem; text-transform: uppercase;
     letter-spacing: .05em; border-bottom: 1px solid var(--border); }
td { padding: .55rem .9rem; border-bottom: 1px solid #f1f5f9; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f8fafc; }

/* --- Badges ----------------------------------------------- */
.badge-exact {
  background: var(--green-bg); color: var(--green);
  padding: .2rem .6rem; border-radius: 20px; font-size: .78rem; font-weight: 700;
}
.badge-diff {
  background: var(--amber-bg); color: var(--amber);
  padding: .2rem .6rem; border-radius: 20px; font-size: .78rem; font-weight: 600;
}
.type-badge { font-size: .72rem; font-weight: 600; padding: .15rem .55rem; border-radius: 20px; white-space: nowrap; }
.type-single  { background: #e0f2fe; color: #0369a1; }
.type-pair    { background: #ede9fe; color: #6d28d9; }
.type-triplet { background: #fef3c7; color: #b45309; }
.type-dpe     { background: #ecfdf5; color: #065f46; }

/* --- DPE A-G label badges --------------------------------- */
.dpe-label, .dpe-ges-label {
  font-size: .72rem; font-weight: 700;
  padding: .15rem .5rem; border-radius: 20px; white-space: nowrap;
}
.dpe-label-a { background: #166534; color: #fff; }
.dpe-label-b { background: #15803d; color: #fff; }
.dpe-label-c { background: #65a30d; color: #fff; }
.dpe-label-d { background: #ca8a04; color: #fff; }
.dpe-label-e { background: #ea580c; color: #fff; }
.dpe-label-f { background: #dc2626; color: #fff; }
.dpe-label-g { background: #7f1d1d; color: #fff; }

/* --- Results section title -------------------------------- */
.results-section-title {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted);
  margin: 2rem 0 .5rem; padding: .35rem .75rem;
  border-left: 3px solid var(--gold); background: #fffbf0;
  border-radius: 0 4px 4px 0;
}

/* --- Summary DPE stat ------------------------------------- */
.summary-stat-dpe .summary-stat-value { color: #065f46; }
.summary-stat-dpe { border-color: #d1fae5; }
.badge { font-size: .75rem; font-weight: 600; padding: .15rem .6rem; border-radius: 20px; }
.badge-city  { background: #e0f2fe; color: #0369a1; }
.badge-surf  { background: var(--amber-bg); color: var(--amber); }
.badge-price { background: #f0fdf4; color: var(--green); }
.badge-count { background: var(--navy); color: white; }

/* --- Map link --------------------------------------------- */
.gmaps-link {
  display: inline-flex; align-items: center; gap: .3rem;
  color: #1a73e8; text-decoration: none; font-weight: 500; font-size: .85rem;
}
.gmaps-link:hover { text-decoration: underline; }
.gmaps-link::before { content: "📍"; font-size: .8rem; }
.gmaps-tick { color: var(--green); font-weight: 700; }

/* --- Misc ------------------------------------------------- */
.empty { color: var(--muted); font-style: italic; font-size: .88rem; padding: .5rem 0; }
.error-msg {
  background: var(--red-bg); border-left: 3px solid var(--red);
  border-radius: 8px; padding: 1rem 1.2rem; color: var(--red); margin-bottom: 1.5rem;
}

/* --- Buy page --------------------------------------------- */
.balance { text-align: center; background: var(--bg); border-radius: 10px;
           padding: 1rem; margin-bottom: 1.8rem; }
.balance-num { font-size: 2rem; font-weight: 700; color: var(--navy); }
.balance-lbl { font-size: .8rem; color: var(--muted); text-transform: uppercase;
               letter-spacing: .06em; margin-top: .1rem; }
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem;
         margin-bottom: 1.5rem; }
.pack { border: 2px solid var(--border); border-radius: 10px; padding: .9rem .5rem;
        text-align: center; cursor: pointer; transition: all .15s; user-select: none; }
.pack:hover, .pack.selected { border-color: var(--gold); background: #fffbf0; }
.pack .credits { font-size: 1.4rem; font-weight: 700; color: var(--navy); }
.pack .label   { font-size: .72rem; color: var(--muted); margin-top: .1rem; }
.pack .price   { font-size: .85rem; font-weight: 600; color: var(--gold); margin-top: .3rem; }
.stripe-note { text-align: center; font-size: .75rem; color: var(--muted); margin-top: .8rem; }
.secure-badge {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  margin-top: 1rem; padding: .55rem 1rem;
  background: #f0faf3; border: 1px solid #b7e4c7; border-radius: 8px;
  font-size: .78rem; color: #1a6b3a;
}
.secure-badge svg { flex-shrink: 0; }

/* --- History page ----------------------------------------- */
.history-main { max-width: 1100px; margin: 2rem auto; padding: 0 1.5rem 3rem; }
.history-main h1 { font-size: 1.4rem; font-weight: 700; color: var(--navy); margin-bottom: 1.4rem; }
.history-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 1.2rem; overflow: hidden;
}
.history-header {
  background: #f8fafc; padding: .8rem 1.4rem;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); cursor: pointer; user-select: none;
}
.history-header:hover { background: #f1f5f9; }
.history-meta  { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.history-date  { font-size: .78rem; color: var(--muted); }
.history-title { font-weight: 600; color: var(--navy); font-size: .95rem; }
.history-badges { display: flex; gap: .5rem; flex-wrap: wrap; }
.toggle-icon { font-size: 1rem; color: var(--muted); transition: transform .2s; }
.history-body { padding: 1.2rem 1.4rem; display: none; }
.history-body.open { display: block; }
.result-url { word-break: break-all; font-size: .8rem; color: var(--muted); margin-bottom: 1rem; }
.result-url a { color: #1a73e8; }
.history-subsection {
  font-size: .85rem; font-weight: 700; color: var(--navy);
  margin: 1rem 0 .6rem; padding-bottom: .3rem;
  border-bottom: 1px solid var(--border);
}
.empty-sub { color: var(--muted); font-style: italic; font-size: .85rem; }
.popup-warning {
  background: var(--amber-bg); border-left: 3px solid var(--amber);
  border-radius: 6px; padding: .65rem 1rem; color: var(--amber);
  font-size: .85rem; font-weight: 500; margin-bottom: 1rem;
}

/* --- Home page -------------------------------------------- */
.home-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }

/* Hero */
.home-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #1e3a5f 0%, #2d6096 55%, #3a7ab8 100%);
  padding: 1rem 2rem 3rem;
}
.home-hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(79,70,229,.18) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(46,125,158,.2) 0%, transparent 60%);
}
.home-hero-inner {
  position: relative; text-align: center; max-width: 680px;
}
.home-hero-logo { width: 420px; max-width: 85%; margin-bottom: 2.5rem; }
.home-hero-h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; color: #fff;
  line-height: 1.25; margin-bottom: 1.2rem; letter-spacing: -.02em;
}
.home-hero-sub {
  font-size: 1.1rem; color: rgba(255,255,255,.75); line-height: 1.75;
  margin-bottom: 2.4rem;
}
.home-hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.2rem; }
.home-cta {
  display: inline-block; padding: .9rem 2.2rem;
  background: linear-gradient(135deg, var(--gold), #e0b84a);
  color: var(--navy); font-size: 1rem; font-weight: 700;
  border-radius: 10px; text-decoration: none;
  box-shadow: 0 4px 20px rgba(201,168,76,.35); transition: transform .15s, box-shadow .15s;
}
.home-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(201,168,76,.5); }
.home-cta-secondary {
  display: inline-block; padding: .9rem 2.2rem;
  background: rgba(255,255,255,.1); color: #fff;
  border: 1.5px solid rgba(255,255,255,.3); border-radius: 10px;
  font-size: 1rem; font-weight: 600; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.home-cta-secondary:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.5); }
.home-hero-note { font-size: .82rem; color: rgba(255,255,255,.45); }
.home-hero-stats { font-size: .82rem; color: rgba(255,255,255,.45); margin-top: .5rem; }
.home-hero-badge {
  display: inline-flex; align-items: center; gap: .45rem;
  background: rgba(201,168,76,.15); border: 1px solid rgba(201,168,76,.4);
  color: var(--gold); font-size: .78rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  padding: .3rem .9rem; border-radius: 2rem; margin-bottom: 1.4rem;
}

.home-hero-form { width: 100%; max-width: 580px; margin: 0 auto 1.5rem; }
.home-hero-input-row {
  display: flex; gap: .5rem; background: rgba(255,255,255,.07);
  border: 1.5px solid rgba(255,255,255,.18); border-radius: 12px;
  padding: .35rem .35rem .35rem .9rem;
  transition: border-color .2s;
}
.home-hero-input-row:focus-within { border-color: rgba(201,168,76,.6); }
.home-hero-input-row input {
  flex: 1; background: none; border: none; outline: none;
  font-size: .95rem; color: #fff; padding: .4rem 0;
  font-family: inherit;
}
.home-hero-input-row input::placeholder { color: rgba(255,255,255,.4); }
.home-hero-input-row button {
  width: auto; margin: 0; padding: .6rem 1.4rem;
  background: linear-gradient(135deg, var(--gold), #e0b84a);
  color: var(--navy); font-size: .9rem; font-weight: 700;
  border-radius: 8px; border: none; cursor: pointer;
  transition: opacity .15s; white-space: nowrap;
}
.home-hero-input-row button:hover { opacity: .9; }

/* Shared section layout */
.home-section-inner { max-width: 1100px; margin: 0 auto; padding: 0 2rem; width: 100%; }
.home-section-title {
  font-size: clamp(1.3rem, 3vw, 1.9rem); font-weight: 800;
  color: var(--navy); text-align: center; margin-bottom: .75rem; letter-spacing: -.02em;
}
.home-section-sub { text-align: center; color: var(--muted); font-size: 1rem; margin-bottom: 3rem; }

/* Steps */
.home-platforms-section { padding: 3rem 2rem; background: var(--light); }
.home-platforms { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; margin-top: 1.5rem; }
.platform-chip {
  padding: .6rem 1.4rem; border-radius: 2rem;
  border: 1.5px solid var(--border); background: #fff;
  font-size: .9rem; font-weight: 600; color: var(--navy);
  text-decoration: none; box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: border-color .15s, color .15s, transform .15s, box-shadow .15s;
}
.platform-chip:hover {
  border-color: var(--gold); color: var(--gold);
  transform: translateY(-2px); box-shadow: 0 6px 16px rgba(201,168,76,.2);
}

.home-steps-section { padding: 5rem 2rem; background: #fff; }
.home-steps {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 0; flex-wrap: wrap;
}
.home-step {
  flex: 1; min-width: 200px; max-width: 280px;
  text-align: center; padding: 1.5rem 1rem;
}
.home-step-num {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #e0b84a);
  color: var(--navy); font-size: 1.3rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.2rem; box-shadow: 0 4px 16px rgba(201,168,76,.3);
}
.home-step h3 { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: .5rem; }
.home-step p { font-size: .88rem; color: var(--muted); line-height: 1.6; }
.home-step-arrow {
  font-size: 1.5rem; color: var(--border); align-self: center;
  padding: 0 .5rem; margin-top: -1rem;
}

/* Features */
.home-features-section { padding: 5rem 2rem; background: var(--bg); }
.home-features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.home-feature {
  background: var(--white); border-radius: var(--radius);
  padding: 2rem 1.8rem; box-shadow: var(--shadow);
  border-top: 3px solid var(--gold);
  transition: transform .15s, box-shadow .15s;
}
.home-feature:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.home-feature-icon { font-size: 1.8rem; margin-bottom: .9rem; }
.home-feature h3 { font-size: .95rem; font-weight: 700; color: var(--navy); margin-bottom: .5rem; }
.home-feature p { font-size: .85rem; color: var(--muted); line-height: 1.65; }

/* Pricing */
.home-pricing-section {
  padding: 5rem 2rem;
  background: linear-gradient(150deg, #0f172a 0%, #1e3a5f 100%);
}
.home-pricing-section .home-section-title { color: #fff; }
.home-pricing-section .home-section-sub { color: rgba(255,255,255,.6); }
.home-pricing {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; margin-bottom: 0;
}
.home-price-card {
  position: relative;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px; padding: 2rem 1.5rem; text-align: center;
  transition: transform .15s, background .15s;
}
.home-price-card:hover { transform: translateY(-3px); background: rgba(255,255,255,.11); }
.home-price-card.home-price-popular {
  background: rgba(201,168,76,.15); border-color: rgba(201,168,76,.5);
}
.home-price-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--gold), #e0b84a);
  color: var(--navy); font-size: .72rem; font-weight: 800;
  padding: .25rem .9rem; border-radius: 20px; white-space: nowrap;
}
.home-price-qty { font-size: .9rem; font-weight: 600; color: rgba(255,255,255,.65); margin-bottom: .6rem; }
.home-price-amount { font-size: 2.2rem; font-weight: 800; color: #fff; line-height: 1; margin-bottom: .5rem; }
.home-price-unit { font-size: .78rem; color: rgba(255,255,255,.45); }

/* Footer */
.home-footer {
  padding: 1.5rem 2rem; font-size: .8rem; color: var(--muted);
  border-top: 1px solid var(--border); background: #fff;
}
.home-footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
}
.home-footer-links { display: flex; gap: 1.5rem; }
.home-footer-links a { color: var(--muted); text-decoration: none; }
.home-footer-links a:hover { color: var(--navy); }

/* --- FAQ --------------------------------------------------- */
.home-faq-section { background: var(--light); padding: 4rem 1.5rem; }
.home-faq { max-width: 720px; margin: 2rem auto 0; display: flex; flex-direction: column; gap: .75rem; }
.faq-item { border: 1px solid var(--border); border-radius: .75rem;
            background: #fff; overflow: hidden; }
.faq-item summary { padding: 1rem 1.25rem; font-weight: 600; font-size: .95rem;
                    cursor: pointer; list-style: none; display: flex;
                    justify-content: space-between; align-items: center; color: var(--navy); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.2rem; color: var(--gold);
                           transition: transform .2s; flex-shrink: 0; margin-left: .5rem; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 1.25rem 1rem; margin: 0; font-size: .9rem;
              color: var(--muted); line-height: 1.6; }

/* --- Favorites button (in results tables) ----------------- */
.btn-fav {
  background: none; border: none; cursor: pointer;
  font-size: 1.15rem; color: var(--muted); padding: 0 .2rem;
  transition: color .15s, transform .15s;
}
.btn-fav:hover { color: var(--gold); transform: scale(1.2); }
.btn-fav.fav-saved { color: var(--gold); cursor: default; }
.fav-wrap { position: relative; display: inline-flex; align-items: center; }
.fav-tooltip {
  position: absolute; right: calc(100% + .4rem); top: 50%; transform: translateY(-50%);
  background: var(--navy); color: #fff; font-size: .72rem; font-weight: 600;
  white-space: nowrap; padding: .25rem .5rem; border-radius: .4rem;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.fav-tooltip::after {
  content: ''; position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
  border: 5px solid transparent; border-left-color: var(--navy);
}
.fav-wrap:hover .fav-tooltip { opacity: 1; }
.confirmed-badge { color: var(--gold); font-weight: 600; font-size: .82rem; }

/* --- Toast notification ----------------------------------- */
#fav-toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(1rem);
  background: #1a1a2e; color: #fff;
  padding: .75rem 1.5rem; border-radius: 8px;
  font-size: .9rem; font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 9999;
}
#fav-toast.fav-toast-show {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* --- Favorites page --------------------------------------- */
.fav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.fav-card-img {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
  border-radius: var(--radius) var(--radius) 0 0;
}
.fav-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 1.2rem 1.4rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.fav-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .5rem; }
.fav-title { font-size: 1rem; font-weight: 700; color: var(--navy); }
.fav-zip { font-weight: 400; color: var(--muted); font-size: .9rem; }
.fav-date { font-size: .78rem; color: var(--muted); }
.fav-parcel { font-size: .95rem; font-weight: 600; color: var(--navy); margin-bottom: .6rem; }
.fav-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }
.fav-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.btn-gmaps {
  display: inline-block; padding: .45rem .9rem;
  background: var(--navy); color: #fff; border-radius: 6px;
  font-size: .85rem; font-weight: 600; text-decoration: none;
}
.btn-gmaps:hover { background: #1a3a6c; }
.btn-listing {
  display: inline-block; padding: .45rem .9rem;
  background: var(--surface); color: var(--navy); border-radius: 6px;
  font-size: .85rem; font-weight: 600; text-decoration: none;
  border: 1px solid var(--border);
}
.btn-listing:hover { background: var(--border); }
.btn-fav-delete {
  background: none; border: none; color: var(--muted);
  font-size: .78rem; cursor: pointer; padding: 0; text-decoration: underline;
}
.btn-fav-delete:hover { color: #c0392b; }

/* --- Admin ------------------------------------------------ */
.admin-wrap {
  max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem;
}
.admin-info-box {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 8px; padding: .6rem .9rem;
}
.admin-info-label { font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.admin-info-val   { font-size: .9rem; font-weight: 500; color: var(--navy); margin-top: .15rem; }
.admin-title {
  font-size: 1.6rem; font-weight: 700; color: var(--navy);
  margin-bottom: 1.8rem;
}
.admin-stats {
  display: flex; gap: 1.2rem; margin-bottom: 2.5rem; flex-wrap: wrap;
}
.admin-stat {
  background: var(--white); border-radius: var(--radius);
  padding: 1.2rem 2rem; box-shadow: var(--shadow);
  border-top: 3px solid #2E7D9E; min-width: 140px;
}
.admin-stat-value {
  font-size: 2rem; font-weight: 700; color: var(--navy);
}
.admin-stat-label {
  font-size: .8rem; color: var(--muted); margin-top: .2rem; text-transform: uppercase; letter-spacing: .06em;
}
.admin-section {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 2rem;
}
.admin-section h2 {
  font-size: 1rem; font-weight: 700; color: var(--navy);
  margin-bottom: 1rem; text-transform: uppercase; letter-spacing: .05em;
}
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%; border-collapse: collapse; font-size: .87rem;
}
.admin-table th {
  text-align: left; padding: .5rem .8rem;
  font-size: .75rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 2px solid var(--border);
}
.admin-table td {
  padding: .6rem .8rem; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg); }
.muted-cell { color: var(--muted); font-size: .82rem; }
.url-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url-cell a { color: var(--navy); text-decoration: none; }
.url-cell a:hover { text-decoration: underline; }
.credit-badge {
  display: inline-block; background: var(--green-bg); color: var(--green);
  font-weight: 700; padding: .15rem .55rem; border-radius: 20px; font-size: .85rem;
}
.credit-badge.credit-empty { background: var(--red-bg); color: var(--red); }
.credit-actions { display: flex; gap: .3rem; align-items: center; }
.btn-credit {
  border: none; border-radius: 6px; padding: .25rem .55rem;
  font-size: .82rem; font-weight: 700; cursor: pointer;
}
.btn-minus { background: var(--red-bg); color: var(--red); }
.btn-minus:hover { background: var(--red); color: white; }
.btn-plus { background: var(--green-bg); color: var(--green); }
.btn-plus:hover { background: var(--green); color: white; }
.btn-plus10 { background: #dbeafe; color: #1d4ed8; }
.btn-plus10:hover { background: #1d4ed8; color: white; }
.btn-delete {
  background: none; border: 1px solid var(--red); color: var(--red);
  border-radius: 6px; padding: .25rem .65rem; font-size: .82rem; cursor: pointer;
}
.btn-delete:hover { background: var(--red); color: white; }
.verified-badge {
  display: inline-block; background: var(--green-bg); color: var(--green);
  font-weight: 700; padding: .15rem .55rem; border-radius: 20px; font-size: .85rem;
}
.unverified-badge {
  display: inline-block; background: var(--amber-bg); color: var(--amber);
  font-weight: 600; padding: .15rem .55rem; border-radius: 20px; font-size: .8rem;
}

/* --- Commune autocomplete --------------------------------- */

/* --- Summary card (pre-confirm) --------------------------- */
.summary-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 2rem 2.4rem;
  margin: 1.5rem auto; max-width: 700px;
  border-top: 4px solid #2E7D9E;
}
.summary-title {
  font-size: 1.1rem; font-weight: 700; color: var(--navy); margin-bottom: 1.4rem;
}
.summary-stats {
  display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem;
}
.summary-stat {
  background: var(--bg); border-radius: 10px;
  padding: .9rem 1.4rem; text-align: center; min-width: 100px;
}
.summary-stat-exact {
  background: var(--green-bg);
}
.summary-stat-value {
  font-size: 1.8rem; font-weight: 700; color: var(--navy);
}
.summary-stat-exact .summary-stat-value { color: var(--green); }
.summary-stat-label {
  font-size: .75rem; color: var(--muted); margin-top: .2rem; text-transform: uppercase; letter-spacing: .04em;
}
.confidence {
  font-size: .9rem; border-radius: 8px; padding: .6rem 1rem;
  margin-bottom: 1rem; line-height: 1.5;
}
.confidence-high   { color: #14532d; background: #dcfce7; border: 1px solid #86efac; }
.confidence-good   { color: #1e3a5f; background: #dbeafe; border: 1px solid #93c5fd; }
.confidence-medium { color: #92400e; background: #fef3c7; border: 1px solid #fcd34d; }
.summary-msg {
  font-size: .95rem; color: var(--text); margin-bottom: 1.4rem; line-height: 1.6;
}
.summary-msg small { color: var(--muted); }
.summary-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn-confirm {
  background: #2E7D9E; color: white; border: none;
  padding: .75rem 1.6rem; border-radius: 8px; font-size: .95rem;
  font-weight: 600; cursor: pointer;
}
.btn-confirm:hover { background: #1a5f7a; }
.btn-cancel {
  background: none; border: 1px solid var(--border); color: var(--muted);
  padding: .75rem 1.4rem; border-radius: 8px; font-size: .95rem; cursor: pointer;
}
.btn-cancel:hover { border-color: var(--red); color: var(--red); }

/* --- Notice (info) message -------------------------------- */
.notice-msg {
  background: #dbeafe; border-left: 3px solid #2563eb;
  border-radius: 6px; padding: .7rem .9rem; color: #1e40af;
  font-size: .87rem; margin: .8rem 0;
}

/* ============================================================
   Responsive — mobile (≤ 640px)
   ============================================================ */
@media (max-width: 640px) {

  /* Header */
  .global-header, header {
    padding: 0 1rem; height: auto; min-height: 56px; flex-wrap: wrap; gap: .4rem;
    padding-top: .4rem; padding-bottom: .4rem;
  }
  .header-logo img { height: 36px; }
  .header-right { gap: .5rem; flex-wrap: wrap; }
  .logout-btn, .nav-btn { font-size: .75rem; padding: .25rem .55rem; }
  .credits-badge { font-size: .75rem; padding: .25rem .65rem; }

  /* Main content */
  main { margin: 1rem auto; padding: 0 .75rem 2rem; }

  /* Search card */
  .search-card { padding: 1.2rem 1rem; }
  .input-row { flex-direction: column; gap: .5rem; }
  .input-row button { width: 100%; margin-top: 0; }
  .commune-autocomplete { max-width: 100%; min-width: 0; }

  /* Info grid */
  .info-grid { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
  .info-box { padding: .9rem 1rem; }
  .info-box .val { font-size: 1rem; }

  /* Results tables — horizontal scroll */
  .section-body { padding: 1rem .75rem; }
  .section-header { padding: .8rem 1rem; flex-wrap: wrap; gap: .4rem; }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Summary card */
  .summary-card { padding: 1.4rem 1rem; }
  .summary-actions { flex-direction: column; }
  .btn-confirm, .btn-cancel { width: 100%; text-align: center; }

  /* Card pages (login, buy, register…) */
  .card { padding: 2rem 1.2rem; }
  .page-centered { align-items: flex-start; padding-top: 2rem; }

  /* Buy — packs 2 columns */
  .packs { grid-template-columns: repeat(2, 1fr); }

  /* History */
  .history-main { padding: 0 .75rem 2rem; }
  .history-header { padding: .7rem 1rem; }
  .history-meta { gap: .6rem; }
  .history-body { padding: .9rem 1rem; }

  /* Favorites */
  .fav-grid { grid-template-columns: 1fr; }
  .parcels-grid { grid-template-columns: 1fr 1fr; gap: .6rem; padding: .75rem; }

  /* Home page */
  .home-hero { padding: 2rem 1.2rem 2.5rem; }
  .home-hero-logo { width: 260px; }
  .home-hero-sub { font-size: .95rem; }
  .home-hero-actions { flex-direction: column; align-items: center; }
  .home-steps { flex-direction: column; align-items: center; }
  .home-step-arrow { transform: rotate(90deg); margin: 0; padding: .25rem 0; }
  .home-features { grid-template-columns: 1fr; gap: 1rem; }
  .home-feature { padding: 1.4rem 1.2rem; }
  .home-pricing { grid-template-columns: 1fr 1fr; }
  .home-footer-inner { flex-direction: column; text-align: center; }

  /* Admin */
  .admin-wrap { padding: 1rem .75rem; }
  .admin-stats { gap: .7rem; }
}

/* --- Legal pages ------------------------------------------ */
.legal-footer {
  display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap;
  padding: 1.5rem 1rem; margin-top: 2rem;
  border-top: 1px solid var(--border); font-size: .78rem; color: var(--muted);
}
.legal-footer a { color: var(--muted); text-decoration: none; }
.legal-footer a:hover { color: var(--accent); }

.legal-page {
  max-width: 760px; margin: 2rem auto; padding: 0 1.5rem 3rem;
}
.legal-page h1 {
  font-size: 1.6rem; font-weight: 700; margin-bottom: .25rem;
}
.legal-page h2 {
  font-size: 1.1rem; font-weight: 600; margin: 1.8rem 0 .5rem;
  padding-bottom: .3rem; border-bottom: 1px solid var(--border);
}
.legal-page h3 { font-size: .95rem; font-weight: 600; margin: 1.2rem 0 .4rem; }
.legal-page p, .legal-page li { font-size: .9rem; line-height: 1.7; color: var(--text); }
.legal-page ul { padding-left: 1.4rem; margin: .5rem 0; }
.legal-page a { color: var(--accent); }
.legal-updated { font-size: .8rem; color: var(--muted); margin-bottom: 1rem; }
