:root{
  --black:#242424;
  --white:#fff;
  --grey:#f3f3f3;
  --s-grey:#8e8e8e;
  --d-grey:#595959;
  --orange:#f9d6c3;
  --d-orange:#f06d22;
  --green:#49c2bb;
  --l-green:#eaf8f4;
  --main-green:#e1fbfa;
  --red:#ff1d1d;
  --brs:1.25rem;
  --brs-lg:1.5rem;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, "SF UI Display", "Segoe UI", Roboto, Arial, sans-serif;
  color:var(--black);
  background:var(--white);
  line-height:1.45;
}

a{color:inherit;text-decoration:none}
a:hover{text-decoration:none}
img{max-width:100%;height:auto}

.container-fluid{
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.header{
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(36,36,36,.08);
}

.header-inner{
  display:flex;
  align-items:center;
  gap:14px;
  min-height:72px;
}

.header-logo{
  display:flex;
  align-items:center;
  gap:10px;
  min-width: 110px;
}
.header-logo img{
  width:auto;
  height:44px;
  display:block;
}

.header-nav{flex:1}

.header-menu{
  list-style:none;
  display:flex;
  align-items:center;
  gap:8px;
  margin:0;
  padding:0;
  flex-wrap:wrap;
}

.header-menu a{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:999px;
  font-weight:700;
  font-size:14px;
  color:var(--black);
}
.header-menu a:hover{ background: var(--main-green); }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  border:0;
  cursor:pointer;
  font-weight:800;
  line-height:1;
  white-space:nowrap;
  text-decoration:none;
}

.btn-lk-new{
  padding:10px 14px;
  border-radius:999px;
  background:var(--green);
  color:#fff;
  box-shadow: 0 10px 22px rgba(73,194,187,.25);
}
.btn-lk-new:hover{ filter: brightness(.97); }

.btn-ghost{
  padding:10px 12px;
  border-radius:999px;
  background: transparent;
  color: var(--black);
}
.btn-ghost:hover{ background: var(--grey); }

.btn-outline{
  padding:10px 14px;
  border-radius:999px;
  background: var(--l-green);
  color: var(--black);
  border: 1px solid rgba(73,194,187,.35);
}
.btn-outline:hover{ background: var(--main-green); }

.btn-orange{
  padding:10px 14px;
  border-radius:999px;
  background: var(--d-orange);
  color:#fff;
}
.btn-orange:hover{ filter: brightness(.98); }

/* Alias used across internal templates */
.btn-primary{
  padding:10px 14px;
  border-radius:999px;
  background:var(--green);
  color:#fff;
  box-shadow: 0 10px 22px rgba(73,194,187,.25);
}
.btn-primary:hover{ filter: brightness(.97); }

/* Layout utils */
.row{display:flex; align-items:center; gap:10px; flex-wrap:wrap;}
.row-between{justify-content:space-between;}
.stack{display:flex; flex-direction:column; gap:12px;}
.mt{margin-top:12px;}
.mt-xs{margin-top:8px;}
.section{padding: 6px 0;}

.h1{margin:0; font-size: 30px; line-height:1.1; letter-spacing:-0.02em;}
.h3{margin:0; font-size: 18px; font-weight: 900;}

.grid-cards{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 980px){
  .grid-cards{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px){
  .grid-cards{ grid-template-columns: 1fr; }
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--main-green);
  border: 1px solid rgba(73,194,187,.25);
  font-weight: 900;
  font-size: 13px;
}

.divider{height:1px; background: rgba(36,36,36,.08); margin: 12px 0;}

.notice{
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(73,194,187,.25);
  background: var(--main-green);
}

.nav-burger{
  display:none;
  padding:10px 12px;
  border-radius:999px;
  background: var(--grey);
}
.nav-burger svg{ width:18px; height:18px; }

@media (max-width: 860px){
  .header-menu{ display:none; }
  .nav-burger{ display:inline-flex; }
  .header.is-open .header-menu{
    display:flex;
    position:absolute;
    top:72px;
    left:0;
    right:0;
    flex-direction:column;
    align-items:flex-start;
    gap:6px;
    padding:12px 16px 16px 16px;
    background: rgba(255,255,255,.98);
    border-bottom: 1px solid rgba(36,36,36,.08);
  }
  .header.is-open .header-menu a{
    width:100%;
    justify-content:flex-start;
  }
}

.main{
  padding: 28px 0 56px;
}

.page{
  display:grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.page-title{
  margin:0;
  font-size: 32px;
  line-height:1.1;
  letter-spacing: -0.02em;
}
@media (max-width: 420px){
  .page-title{ font-size: 28px; }
}

.muted{ color: var(--d-grey); }
.small{ font-size: 14px; }

.card{
  background: #fff;
  border: 1px solid rgba(36,36,36,.08);
  border-radius: var(--brs-lg);
  box-shadow: 0 18px 40px rgba(0,0,0,.06);
  padding: 18px;
}

.card.soft{
  background: var(--l-green);
  border-color: rgba(73,194,187,.20);
  box-shadow: none;
}

.grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 720px){
  .grid-2{ grid-template-columns: 1fr; }
}

.field{ display:flex; flex-direction:column; gap:8px; margin: 12px 0; }
.label{ font-weight:800; font-size:14px; }
.input{
  width:100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(36,36,36,.12);
  outline: none;
  font-size: 16px;
  background: #fff;
}
.input:focus{
  border-color: rgba(73,194,187,.65);
  box-shadow: 0 0 0 4px rgba(73,194,187,.18);
}

/* Form controls (select/textarea/checkbox) */
.select{
  width:100%;
  padding: 12px 44px 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(36,36,36,.12);
  outline: none;
  font-size: 16px;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(36,36,36,.75) 50%),
    linear-gradient(135deg, rgba(36,36,36,.75) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.select:focus{
  border-color: rgba(73,194,187,.65);
  box-shadow: 0 0 0 4px rgba(73,194,187,.18);
}

.textarea{
  width:100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(36,36,36,.12);
  outline: none;
  font-size: 16px;
  background: #fff;
  resize: vertical;
}
.textarea:focus{
  border-color: rgba(73,194,187,.65);
  box-shadow: 0 0 0 4px rgba(73,194,187,.18);
}

.checkbox{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  font-size:14px;
}
.checkbox input{
  width:18px;
  height:18px;
  accent-color: var(--green);
}

/* Simple layout helpers used in templates */
.row{display:flex; align-items:center; gap:10px; flex-wrap:wrap;}
.row-between{justify-content:space-between;}
.stack{display:flex; flex-direction:column; gap:12px;}
.mt{margin-top:14px;}
.mt-xs{margin-top:8px;}

.h1{margin:0; font-size:32px; line-height:1.1; letter-spacing:-0.02em;}
.h3{font-weight:900; font-size:18px;}

.btn-primary{
  padding:12px 14px;
  border-radius:999px;
  background: linear-gradient(135deg, var(--green), #2aaea6);
  color:#fff;
  box-shadow: 0 10px 22px rgba(73,194,187,.22);
}
.btn-primary:hover{filter:brightness(.98)}

.grid-cards{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 980px){
  .grid-cards{grid-template-columns: repeat(2, 1fr);}
}

.card-link{transition: transform .08s ease, box-shadow .08s ease;}
.card-link:hover{transform: translateY(-1px); box-shadow: 0 22px 50px rgba(0,0,0,.08);}

.pill{
  display:inline-flex;
  align-items:center;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--main-green);
  border: 1px solid rgba(73,194,187,.25);
  font-weight:900;
  font-size: 13px;
}

.notice{
  padding:12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(73,194,187,.22);
  background: var(--l-green);
}

.divider{height:1px; background: rgba(36,36,36,.08); margin: 12px 0;}

.form-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 14px;
}

.flash{
  padding:12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(36,36,36,.08);
  background: var(--grey);
  margin-bottom: 12px;
}
.flash.ok{ background: var(--main-green); border-color: rgba(73,194,187,.25); }
.flash.err{ background: #fff3f3; border-color: rgba(255,29,29,.20); }

.footer{
  border-top: 1px solid rgba(36,36,36,.08);
  padding: 18px 0 24px;
  color: var(--d-grey);
}
.footer-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.footer a{ color: var(--d-grey); }
.footer a:hover{ color: var(--black); }

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--main-green);
  border: 1px solid rgba(73,194,187,.25);
  font-weight:800;
  font-size: 13px;
}

.kbd{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(36,36,36,.12);
}


.box-scroll{max-height:220px; overflow:auto; padding:8px; border:1px solid rgba(255,255,255,.10); border-radius:12px; background:rgba(255,255,255,.03)}

@media (max-width:720px){
  .grid-cards{grid-template-columns:1fr}
  .grid-2{grid-template-columns:1fr}
  .row{flex-wrap:wrap}
  /* Make forms comfy on mobile, but don't break the header */
  .card form .btn{width:100%}
  .header .btn{width:auto}
  .header-inner{flex-wrap:wrap}
  .header-logo{min-width:90px}
  .header-logo img{height:40px}
}


/* Psychologists catalog cards */
.psy-card{display:flex; flex-direction:column; gap:12px}
.psy-top{display:flex; gap:14px; align-items:stretch}
.psy-photo{position:relative; width:220px; flex:0 0 220px; aspect-ratio:3 / 4; border-radius:16px; overflow:hidden; background:linear-gradient(135deg,#e9f7f6,#f6f1ff)}
.psy-photo img{width:100%; height:100%; object-fit:cover; display:block}
.psy-photo-fallback{width:100%; height:100%; background: url('/static/img/avatar_placeholder.svg') center/60% no-repeat;}
.psy-name{position:absolute; left:12px; right:12px; bottom:10px; color:#fff; font-weight:700; font-size:20px; text-shadow:0 2px 14px rgba(0,0,0,.55)}
.psy-meta{flex:1; min-width:0; display:flex; flex-direction:column; justify-content:flex-start}
.psy-desc{line-height:1.5}
.psy-pills{display:flex; flex-wrap:wrap; gap:8px}
.pill-online{background:rgba(46,204,113,.12); border-color:rgba(46,204,113,.35)}
.pill-offline{background:rgba(149,165,166,.10); border-color:rgba(149,165,166,.35)}
@media (max-width: 820px){
  .psy-top{flex-direction:column}
  /* keep portrait ratio on mobile too */
  .psy-photo{width:100%; flex:0 0 auto; height:auto; aspect-ratio:3 / 4; max-height:520px}
}


/* Catalog layout (desktop: results left, filters right; mobile: filters first) */
.catalog-layout{display:grid; grid-template-columns: 1fr 420px; gap:14px; align-items:start}
.catalog-filters{position:sticky; top:92px}
.catalog-head{padding-top:4px}
@media (max-width: 980px){
  .catalog-layout{grid-template-columns:1fr}
  .catalog-filters{position:static; order:-1}
}

/* Psychologist profile header */
.psy-profile-head{display:flex; gap:14px; align-items:flex-start}
.psy-profile-photo{width:200px; flex:0 0 200px; aspect-ratio:3 / 4; border-radius:16px; overflow:hidden; background:linear-gradient(135deg,#e9f7f6,#f6f1ff)}
.psy-profile-photo img{width:100%; height:100%; object-fit:cover; display:block}
.psy-profile-summary{flex:1; min-width:0}
@media (max-width: 820px){
  .psy-profile-head{flex-direction:column}
  /* keep portrait ratio on mobile too */
  .psy-profile-photo{width:100%; flex:0 0 auto; height:auto; aspect-ratio:3 / 4; max-height:520px}
}

/* Upload previews */
.upload-preview{display:flex; flex-direction:column; gap:8px}
.upload-docs{display:flex; flex-direction:column; gap:10px}
.upload-file-item{display:flex; align-items:center; gap:10px; padding:10px 12px; border:1px solid rgba(36,36,36,.10); border-radius:14px; background:rgba(255,255,255,.7)}
.upload-file-thumb{width:56px; height:74px; border-radius:12px; overflow:hidden; border:1px solid rgba(36,36,36,.10); display:flex; align-items:center; justify-content:center; background:#fff; flex:0 0 auto}
.upload-file-thumb.is-large{width:120px; height:160px}
.upload-file-thumb img{width:100%; height:100%; object-fit:cover; display:block}
.upload-file-badge{font-weight:900; font-size:12px; padding:6px 10px; border-radius:999px; border:1px solid rgba(36,36,36,.12); background:rgba(73,194,187,.10)}
.upload-file-meta{min-width:0}
.upload-file-name{font-weight:900; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width: 240px}
