﻿:root {
  --bg: #f3f5f8;
  --paper: #ffffff;
  --text: #1b2638;
  --muted: #6b7788;
  --primary: #0b5cab;
  --line: #dce4ef;
  --ok: #1f9d58;
  --warn: #c97a00;
  --bad: #b7252a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: radial-gradient(circle at top, #f8fbff 0%, var(--bg) 45%);
  color: var(--text);
}
.container { width: min(1140px, 92%); margin: 0 auto; }
.row { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap { gap: 12px; }

.site-header {
  background: linear-gradient(180deg, #0a2643 0%, #103a62 100%);
  border-bottom: 4px solid #d7e4f4;
  padding: 12px 0;
}
.brand { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .5px; }
.brand-with-logo { display: inline-flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.6);
}
.main-nav { display: flex; flex-wrap: wrap; gap: 10px; }
.main-nav a { color: #f0f6ff; text-decoration: none; padding: 8px 10px; border-radius: 6px; }
.main-nav a:hover { background: rgba(255, 255, 255, 0.15); }

.hero {
  background: linear-gradient(130deg, #0f3b67, #205d93);
  color: #fff;
  border-radius: 14px;
  margin: 18px 0;
  padding: 36px;
}
.hero h1 { margin: 0 0 10px; }
.hero p { margin: 0 0 20px; color: #d8e8fb; }
.hero-actions { display: flex; gap: 10px; }
.hero-actions .btn,
.hero-actions .btn-light {
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 600;
}
.hero-actions .btn-light {
  background: #2757e7;
  color: #fff;
  border: 1px solid #2757e7;
}
.hero-actions .btn-light:hover {
  background: #2147bd;
  color: #fff;
}

.btn {
  display: inline-block;
  border: 0;
  background: var(--primary);
  color: white;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.btn-light { background: #f0f6ff; color: #0d4e8b; }
.link { color: var(--primary); }

.grid { display: grid; gap: 14px; margin: 14px 0; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(30, 57, 90, 0.06);
}
.full { grid-column: 1/-1; }
.big { font-size: 2rem; font-weight: 700; margin: 0; }

input, select, textarea, button {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #c8d3e2;
  font: inherit;
  margin-top: 6px;
}
label { font-weight: 600; color: #22374d; }
.muted { color: var(--muted); font-weight: 500; }
.soft { background: #f9fbfe; border-style: dashed; }
.map-box {
  width: 100%;
  height: 340px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 10px 0 12px;
}
.map-tools { align-items: center; margin: 8px 0; }
.map-find-btn { width: auto; min-width: 170px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 10px 6px; }
.admin-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #d4deea;
  background: #fff;
}
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.admin-photo-form { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.admin-photo-form input[type='file'] { margin-top: 0; padding: 6px; }

.status {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .85rem;
  border: 1px solid transparent;
}
.status.active { background: #e6f7ee; color: #14763e; border-color: #b4e1c7; }
.status.suspended { background: #fff5e6; color: #9e5d00; border-color: #ffd598; }
.status.hidden, .status.archived { background: #fbeaec; color: #9a1f28; border-color: #f3bfc5; }

.avatar { width: 180px; max-width: 100%; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); }
.avatar.placeholder { aspect-ratio: 1 / 1; display: grid; place-items: center; background: #eef2f8; color: var(--muted); }
.card-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  margin-bottom: 10px;
}
.qr { width: 200px; max-width: 100%; margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; }
.person-media-card {
  display: grid;
  justify-items: center;
  gap: 12px;
}
.person-media-card .avatar {
  width: min(100%, 320px);
  max-height: 560px;
  height: auto;
  object-fit: contain;
  background: #fff;
  padding: 6px;
}
.person-media-card .qr {
  width: min(100%, 320px);
  margin-top: 0;
}
.qr-actions {
  width: min(100%, 320px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.qr-actions .btn {
  text-align: center;
}

.verify-state { font-weight: 700; }
.verify-state.ok { color: var(--ok); }
.verify-state.warn { color: var(--warn); }
.verify-state.bad { color: var(--bad); }
.trust { border-top: 1px dashed #b4c8de; padding-top: 10px; color: #0e4a84; }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 26px; }
.pagination a {
  text-decoration: none;
  color: var(--text);
  background: white;
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 8px;
}
.pagination a.active { background: var(--primary); color: white; border-color: var(--primary); }

.site-footer { margin-top: 26px; padding: 16px 0; color: #5f7084; text-align: center; }

@media (max-width: 980px) {
  .grid.three, .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; }
  .hero { padding: 20px; }
  .main-nav { margin-top: 8px; }
}

/* Home Redesign */
body {
  font-family: "Montserrat", "Segoe UI", Tahoma, sans-serif;
  background: linear-gradient(180deg, #f4f6fb 0%, #eef2f7 100%);
  color: #122744;
}

.hero {
  background: linear-gradient(130deg, #113f73, #1f63ac);
  border-radius: 18px;
  margin: 22px 0 16px;
  padding: 34px;
  box-shadow: 0 14px 30px rgba(22, 64, 114, 0.25);
}
.hero h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.hero p { font-size: 1.08rem; max-width: 860px; }

.btn {
  background: #2757e7;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.btn-light {
  background: #e9f2ff;
  color: #0f4b96;
  border: 1px solid #cdddf4;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 16px rgba(35, 73, 172, 0.2);
}
.btn-light:hover {
  background: #dcecff;
  color: #0d3f7e;
}

.about-block {
  margin: 22px 0;
  padding: 36px 40px;
  border-radius: 20px;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(circle at 30% 10%, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px) 0 0/40px 40px,
    linear-gradient(135deg, #1d4f9e 0%, #21478b 100%);
  box-shadow: 0 16px 32px rgba(20, 52, 105, 0.26);
}
.about-block h2 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
}
.about-block p {
  margin: 0 auto;
  max-width: 980px;
  font-size: clamp(1rem, 1.2vw, 1.25rem);
  line-height: 1.7;
  font-style: italic;
}

.services-wrap { margin: 26px 0; }
.services-wrap h2 {
  text-align: center;
  margin: 0 0 16px;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  color: #0f2d59;
}
.services-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(330px, 1fr);
  gap: 18px;
  overflow-x: auto;
  padding: 8px 4px 14px;
}
.services-scroll::-webkit-scrollbar { height: 10px; }
.services-scroll::-webkit-scrollbar-thumb { background: #c4cfde; border-radius: 999px; }
.service-card {
  background: #ffffff;
  border: 1px solid #d8e2f0;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(23, 47, 84, 0.08);
  padding: 20px 24px;
}
.service-card h3 {
  margin: 0 0 12px;
  color: #2757e7;
  font-size: 1.15rem;
}
.service-card ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}
.service-card li { color: #28405f; line-height: 1.5; }

.registry-grid .mediator-card { transition: transform .2s ease, box-shadow .2s ease; }
.registry-grid .mediator-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(23, 47, 84, 0.11);
}
.clickable-card {
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: inherit;
}
.mediator-card h3 {
  margin: 2px 0 8px;
  font-size: clamp(1.2rem, 1.3vw, 1.55rem);
  line-height: 1.3;
  overflow-wrap: break-word;
}
.person-name-link { color: inherit; text-decoration: none; }
.person-name-link:hover { text-decoration: underline; }
.clickable-card:focus {
  outline: 2px solid #2757e7;
  outline-offset: 2px;
}

.contact-grid {
  align-items: start;
  margin-bottom: 24px;
}
.contact-card {
  background: #f6f7fa;
  border-color: #e2e8f2;
  padding: 22px 22px 28px;
}
.contact-card h2 {
  margin: 0 0 10px;
  font-size: clamp(1.4rem, 2.5vw, 1.95rem);
}
.contact-sub,
.contact-person,
.contact-phone-label {
  font-size: 1.05rem;
  margin: 0 0 8px;
}
.contact-person { margin-bottom: 12px; }
.contact-phone-label { margin: 10px 0 14px; font-weight: 700; }
.contact-phone-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.phone-btn {
  width: auto;
  min-width: 180px;
  text-align: center;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 700;
}
.map-card {
  overflow: hidden;
  position: relative;
  z-index: 0;
}
.map-card .map-box {
  display: block;
  width: 100%;
  height: 360px;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

@media (max-width: 720px) {
  .about-block { padding: 24px 18px; }
  .services-scroll { grid-auto-columns: minmax(280px, 1fr); }
  .contact-sub, .contact-person, .contact-phone-label { font-size: 1.1rem; }
  .phone-btn { min-width: 145px; }
}

/* Typography + header fixes */
body {
  font-family: "Noto Sans", "Inter", "Segoe UI", Tahoma, sans-serif;
}

.brand-with-logo span {
  line-height: 1.15;
  font-size: 1.05rem;
}

.mediation-block {
  margin: 10px 0 24px;
  padding: 28px 24px 20px;
  border-radius: 14px;
  background: #f5f7fb;
  border: 1px solid #dce4ef;
}
.mediation-block h2 {
  margin: 0 0 10px;
  color: #1f48a1;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
}
.mediation-block p {
  margin: 0 0 16px;
  max-width: 920px;
  color: #233d62;
  font-size: clamp(1rem, 1.2vw, 1.28rem);
  line-height: 1.55;
  font-style: italic;
}
.law-btn {
  background: #fff;
  color: #1f48a1;
  border: 1px solid #dbe3ef;
}
.law-btn:hover {
  background: #f4f7ff;
}

.services-under-registry {
  margin-top: 20px;
  margin-bottom: 24px;
}

.site-footer-extended {
  margin-top: 26px;
  padding: 22px 0;
  background: #0f2f55;
  color: #e8f0fb;
  position: relative;
  z-index: 2;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.footer-brand {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 700;
}
.footer-muted {
  margin: 0;
  color: #b7c8dd;
  font-size: .92rem;
}
.footer-links {
  display: grid;
  gap: 6px;
}
.footer-links a {
  color: #e8f0fb;
  text-decoration: none;
}
.footer-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}
.footer-meta p {
  margin: 0 0 6px;
  text-align: right;
}

.reviews-section h2 { margin-top: 0; }
.reviews-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 18px;
  align-items: start;
}
.review-form {
  display: grid;
  gap: 10px;
  background: #f7faff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.review-form h3 { margin: 0 0 4px; }
.review-form button { width: auto; justify-self: start; margin-top: 4px; }
.hp-field {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.reviews-list { display: grid; gap: 12px; }
.review-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}
.review-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}
.stars {
  color: #d4a017;
  letter-spacing: 1px;
  font-size: 1rem;
  white-space: nowrap;
}
.review-body {
  margin: 0 0 8px;
  white-space: pre-wrap;
  line-height: 1.45;
}
.review-date { margin: 0; font-size: .9rem; }
.review-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.notice {
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 12px;
}
.notice-ok {
  background: #e8f8ee;
  color: #14663a;
  border: 1px solid #b7e2c6;
}
.notice-bad {
  background: #fdeeee;
  color: #9a1f28;
  border: 1px solid #f0c3c8;
}
.review-admin-body {
  max-width: 320px;
  white-space: pre-wrap;
}

.login-page {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(39, 120, 196, 0.28), transparent 42%),
    radial-gradient(circle at 88% 10%, rgba(215, 228, 244, 0.18), transparent 36%),
    linear-gradient(160deg, #071a2e 0%, #0f3b67 48%, #143f6b 100%);
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.login-shell { width: min(440px, 100%); }
.login-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(220, 228, 239, 0.9);
  border-radius: 18px;
  padding: 28px 26px 22px;
  box-shadow: 0 24px 60px rgba(4, 18, 36, 0.35);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.login-brand img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #d7e4f4;
  background: #fff;
}
.login-eyebrow {
  margin: 0 0 4px;
  color: #6b7788;
  font-size: .82rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 700;
}
.login-brand h1 {
  margin: 0;
  font-size: 1.45rem;
  color: #12263d;
}
.login-lead {
  margin: 0 0 18px;
  color: #5d6b7c;
  line-height: 1.45;
}
.login-form {
  display: grid;
  gap: 12px;
}
.login-submit {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  font-weight: 700;
  border-radius: 10px;
}
.login-back {
  display: inline-block;
  margin-top: 16px;
  color: #0b5cab;
  text-decoration: none;
  font-weight: 600;
}
.login-back:hover { text-decoration: underline; }
.admin-logout-form { margin: 0; }
.nav-logout {
  width: auto;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: #f0f6ff;
  cursor: pointer;
  font: inherit;
}
.nav-logout:hover { background: rgba(255, 255, 255, 0.24); }

@media (max-width: 820px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .footer-meta p {
    text-align: left;
  }
  .reviews-layout {
    grid-template-columns: 1fr;
  }
  .grid.two { grid-template-columns: 1fr; }
}
