/* Blue Valley RC */
:root {
  --blue: #1d5fae; --blue-dark: #12407a; --sky: #e8f1fb; --ink: #1c2430; --muted: #5d6b7a;
  --line: #d6dee8; --bg: #f5f8fc; --card: #fff; --red: #b42318; --green: #1f7a3a; --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--blue); }
h1 { font-size: 1.7rem; line-height: 1.2; margin: .4em 0 .5em; }
h2 { font-size: 1.2rem; margin: 1.4em 0 .5em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 18px; padding-bottom: 40px; min-height: 70vh; }
main.narrow { max-width: 560px; }
.muted { color: var(--muted); }
small { font-size: .82rem; color: var(--muted); display: block; margin-top: 3px; }

/* header */
.top { background: linear-gradient(90deg, var(--blue-dark), var(--blue)); color: #fff; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 60px; padding-top: 8px; padding-bottom: 8px; }
.brand { color: #fff; text-decoration: none; font-size: 1.3rem; font-weight: 600; white-space: nowrap; }
.brand b { color: #9fd0ff; }
.brand .logo { display: inline-block; transform: rotate(-30deg); margin-right: 2px; }
.top nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.top nav a { color: #fff; text-decoration: none; font-weight: 500; }
.top nav a:hover { text-decoration: underline; }
.top nav a.btn { background: #fff; color: var(--blue-dark); }
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; padding: 18px 0 28px; text-align: center; }

/* buttons and forms */
.btn { display: inline-block; background: var(--blue); color: #fff; border: 0; border-radius: 8px; padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--blue-dark); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.small { padding: 6px 12px; font-size: .9rem; }
.btn.big { padding: 13px 26px; font-size: 1.1rem; }
.btn.outline { background: #fff; color: var(--blue); border: 1.5px solid var(--blue); }
.btn.outline:hover { background: var(--sky); }
.btn.danger { background: #fff; color: var(--red); border: 1.5px solid var(--red); }
.btn.danger:hover { background: #fdecea; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.form label, .form .label { display: block; font-weight: 600; margin-bottom: 14px; }
input[type=text], input[type=email], input[type=password], input[type=search], input:not([type]), textarea, select {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px; font: inherit; font-weight: 400; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 8px; background: #fff; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--sky); }
input[type=file] { margin-top: 6px; font-weight: 400; }
textarea { resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.notice { background: #e7f6ec; border: 1px solid #b7e1c3; color: #14532d; border-radius: 8px; padding: 10px 14px; margin: 10px 0; }
.error { background: #fdecea; border: 1px solid #f5c2bd; color: var(--red); border-radius: 8px; padding: 10px 14px; margin: 10px 0; }
.narrowform { max-width: 460px; }

/* landing */
.hero { text-align: center; padding: 40px 10px 20px; }
.hero h1 { font-size: 2.3rem; }
.hero p { font-size: 1.15rem; max-width: 640px; margin: 0 auto 18px; color: var(--muted); }
.hero .btn { margin: 6px; }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
.steps3 div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.steps3 b { display: block; color: var(--blue-dark); margin-bottom: 4px; }
.steps3 span { color: var(--muted); }

/* browse */
.searchbar { display: flex; gap: 8px; margin: 4px 0 6px; }
.searchbar input { flex: 1; margin: 0; }
.searchbar select { width: auto; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.tile:hover { box-shadow: 0 6px 18px rgba(18,64,122,.14); transform: translateY(-2px); }
.tile .ph { aspect-ratio: 4 / 3; background: var(--sky); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.tile .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .tx { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.tile .price { font-size: 1.15rem; }
.tile .title { font-weight: 500; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tile .loc { color: var(--muted); font-size: .88rem; }
.empty { text-align: center; }
.pager { display: flex; gap: 6px; justify-content: center; margin: 24px 0; flex-wrap: wrap; }
.pager a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; text-decoration: none; }
.pager a.on { background: var(--blue); color: #fff; border-color: var(--blue); }

/* listing page */
.listing { display: grid; grid-template-columns: 1.25fr 1fr; gap: 26px; align-items: start; }
.gallery .main { display: block; background: #0d1b2a; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; }
.gallery .main img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gallery .nophoto { display: flex; align-items: center; justify-content: center; color: #9fb3c8; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.thumbs button { padding: 0; border: 2px solid var(--line); border-radius: 6px; overflow: hidden; width: 78px; height: 60px; cursor: pointer; background: #fff; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.info h1 { margin-top: 0; }
.price.big { font-size: 1.9rem; font-weight: 700; color: var(--blue-dark); }
.meta { color: var(--muted); }
.desc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; white-space: normal; overflow-wrap: anywhere; }
.owner, .contact { margin-top: 16px; }
.owner .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.owner form { margin: 0; }
.contact h2 { margin-top: 0; }
.contact textarea { margin: 0 0 10px; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 20px; background: var(--sky); color: var(--blue-dark); }
.tag.sold { background: #fdecea; color: var(--red); }
.tag.active { background: #e7f6ec; color: var(--green); }

/* sell form photos */
.curphotos { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.cp { width: 110px; font-weight: 400 !important; margin: 0 !important; font-size: .85rem; }
.cp img { width: 110px; height: 82px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.cp span { display: flex; align-items: center; gap: 4px; margin-top: 3px; }

/* my account */
.mylist { display: flex; flex-direction: column; gap: 10px; }
.myrow { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; padding: 10px; }
.myrow .ph { width: 84px; height: 63px; background: var(--sky); border-radius: 6px; overflow: hidden; flex: none; }
.myrow .ph img { width: 100%; height: 100%; object-fit: cover; }
.myrow .t { flex: 1; }

/* admin */
.stats4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.stats4 div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stats4 b { display: block; font-size: 1.6rem; color: var(--blue-dark); }
.stats4 span { color: var(--muted); font-size: .88rem; }
.tablewrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table.users { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.users th, table.users td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.users tr.blocked td { color: var(--muted); text-decoration: line-through; }
form.inline { display: inline-flex; gap: 6px; margin: 0; }

/* phones */
@media (max-width: 760px) {
  h1 { font-size: 1.45rem; }
  .hero h1 { font-size: 1.8rem; }
  .steps3, .listing, .stats4 { grid-template-columns: 1fr; }
  .stats4 { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile .tx { padding: 8px 9px 10px; }
  .tile .price { font-size: 1rem; }
  .tile .title { font-size: .92rem; }
  .searchbar { flex-wrap: wrap; }
  .searchbar input { flex-basis: 100%; }
  .searchbar select { flex: 1; }
  .top nav { gap: 12px; font-size: .95rem; }
}
