:root {
  --blue: #0563c8;
  --blue-dark: #024d9f;
  --ink: #152033;
  --muted: #68758a;
  --line: #dce3ec;
  --surface: #ffffff;
  --soft: #f5f7fa;
  --shadow: 0 12px 32px rgba(20, 37, 63, .12);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--surface);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
.site-header {
  height: 72px;
  padding: 0 clamp(18px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(255,255,255,.15);
  background: var(--blue-dark);
  color: white;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(18px, 2vw, 23px);
  letter-spacing: -.02em;
}
.brand-mark { font-size: 24px; }
.brand strong { font-weight: 800; }
.login-button {
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 9px;
  font-weight: 700;
  transition: background .18s ease, transform .18s ease;
}
.login-button:hover { background: rgba(255,255,255,.12); transform: translateY(-1px); }
.login-button svg { width: 20px; height: 20px; fill: currentColor; }
.hero {
  padding: clamp(56px, 9vw, 116px) 20px;
  background:
    radial-gradient(circle at 82% 16%, rgba(255,255,255,.14), transparent 28%),
    linear-gradient(135deg, var(--blue-dark), var(--blue));
  color: white;
}
.hero-inner { width: min(1020px, 100%); margin: 0 auto; text-align: center; }
.eyebrow, .section-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0 auto;
  max-width: 850px;
  font-size: clamp(34px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: -.045em;
}
.hero-copy {
  max-width: 760px;
  margin: 20px auto 30px;
  color: rgba(255,255,255,.82);
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.6;
}
.hero-search {
  width: min(800px, 100%);
  min-height: 62px;
  margin: 0 auto;
  padding: 6px 6px 6px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0,0,0,.18);
}
.hero-search svg { width: 24px; height: 24px; fill: #63758a; flex: 0 0 auto; }
.hero-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-size: 17px;
}
.hero-search button {
  align-self: stretch;
  padding: 0 22px;
  border: 0;
  border-radius: 10px;
  color: white;
  background: var(--blue);
  font-weight: 800;
  cursor: pointer;
}
.catalog { width: min(1500px, 100%); margin: 0 auto; padding: 42px clamp(16px, 3vw, 42px) 64px; }
.catalog-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.section-kicker { color: var(--blue); }
.catalog h2 { margin: 0; font-size: clamp(25px, 3vw, 36px); letter-spacing: -.025em; }
.result-count { color: var(--muted); font-size: 14px; white-space: nowrap; }
.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  gap: 10px;
  margin-bottom: 24px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}
.filters label { display: grid; gap: 5px; }
.filters label span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.filters select {
  width: 100%;
  height: 42px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: white;
}
.clear-filters {
  align-self: end;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--blue-dark);
  background: white;
  font-weight: 700;
  cursor: pointer;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.photo-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 3px 14px rgba(31,48,72,.06);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.photo-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.photo-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #e9eef4;
}
.photo-frame img { width: 100%; height: 100%; display: block; object-fit: cover; user-select: none; }
.preview-mark {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  color: white;
  background: rgba(12,29,51,.68);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
}
.photo-meta { padding: 11px 12px 12px; }
.photo-title {
  margin: 0 0 4px;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-author {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.empty-state {
  padding: 60px 20px;
  display: grid;
  gap: 6px;
  place-items: center;
  text-align: center;
  color: var(--muted);
}
.empty-state strong { color: var(--ink); font-size: 18px; }
.load-more-wrap { display: flex; justify-content: center; padding-top: 28px; }
.load-more {
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid var(--blue);
  border-radius: 10px;
  color: var(--blue);
  background: white;
  font-weight: 800;
  cursor: pointer;
}
.photo-dialog {
  width: min(1000px, calc(100vw - 30px));
  max-height: calc(100dvh - 30px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,.28);
}
.photo-dialog::backdrop { background: rgba(4,16,31,.72); }
.photo-dialog[open] { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, .75fr); }
.dialog-preview { min-height: 360px; display: grid; place-items: center; background: #101722; }
.dialog-preview img { width: 100%; height: 100%; max-height: 78dvh; object-fit: contain; user-select: none; }
.dialog-info { padding: 34px 28px; display: flex; flex-direction: column; justify-content: center; }
.dialog-info h2 { margin: 5px 0 8px; overflow-wrap: anywhere; font-size: 25px; }
.dialog-info p { color: var(--muted); line-height: 1.55; }
.preview-badge { margin: 0 !important; color: var(--blue) !important; font-size: 11px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.dialog-note { margin-top: 24px; font-size: 13px; }
.dialog-login { margin-top: 10px; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: white; background: var(--blue); font-weight: 800; }
.dialog-close {
  position: absolute;
  right: 12px;
  top: 10px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  color: var(--ink);
  font-size: 25px;
  cursor: pointer;
}
.site-footer {
  min-height: 72px;
  padding: 18px clamp(18px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #7b8798;
  background: #111b29;
  font-size: 13px;
}
@media (max-width: 900px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clear-filters { width: 100%; }
  .photo-dialog[open] { grid-template-columns: 1fr; overflow-y: auto; }
  .dialog-preview { min-height: 260px; max-height: 52dvh; }
  .dialog-info { padding: 24px 20px; }
}
@media (max-width: 600px) {
  .site-header { height: 62px; padding: 0 14px; }
  .brand strong { display: none; }
  .login-button { min-height: 38px; padding: 0 12px; }
  .hero { padding: 46px 14px 50px; }
  .hero-search { min-height: 56px; padding-left: 14px; gap: 8px; }
  .hero-search button { padding: 0 14px; }
  .catalog { padding: 28px 10px 48px; }
  .catalog-head { align-items: start; flex-direction: column; gap: 7px; }
  .filters { grid-template-columns: 1fr 1fr; padding: 10px; }
  .clear-filters { grid-column: 1 / -1; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .photo-meta { padding: 8px 9px 9px; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}

/* ===== Public Fotobanka v2 ===== */
.brand-nav { display:flex; align-items:center; gap:14px; min-width:0; }
.app-brand, .bank-brand { display:inline-flex; align-items:center; text-decoration:none; }
.header-logo {
  display:block;
  width:auto;
  object-fit:contain;
  background:transparent;
  border-radius:0;
}
.header-logo-desktop { height:56px; }
.header-logo-photobank { height:52px; }
.bank-brand { opacity:.96; }
.bank-brand:hover { opacity:1; }
.login-button { border:0; cursor:pointer; font:inherit; }
.photo-meta { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.photo-meta-text { min-width:0; }
.photo-number { margin:4px 0 0; color:var(--muted); font-size:12px; font-weight:700; letter-spacing:.02em; }
.photo-buy {
  flex:0 0 auto; min-height:34px; padding:7px 12px; border:0; border-radius:8px;
  background:var(--blue); color:#fff; font:inherit; font-size:13px; font-weight:800; cursor:pointer;
}
.photo-buy:hover { background:var(--blue-dark); }
.dialog-login { border:0; cursor:pointer; font:inherit; padding:0 18px; }

.form-dialog {
  width:min(480px, calc(100vw - 28px)); max-height:calc(100dvh - 28px); padding:0;
  border:1px solid var(--line); border-radius:16px; background:#fff; color:var(--ink);
  box-shadow:0 28px 80px rgba(12,32,58,.28); overflow:auto;
}
.form-dialog::backdrop { background:rgba(4,16,31,.62); backdrop-filter:blur(2px); }
.form-dialog .dialog-close { position:sticky; top:8px; float:right; margin:8px 8px -52px 0; z-index:2; }
.dialog-form { padding:30px; display:grid; gap:16px; }
.dialog-form h2 { margin:0 38px 2px 0; font-size:24px; }
.dialog-form label { display:grid; gap:6px; color:var(--ink); font-size:13px; font-weight:700; }
.dialog-form input {
  width:100%; min-height:44px; box-sizing:border-box; border:1px solid var(--line); border-radius:9px;
  padding:10px 12px; background:#fff; color:var(--ink); font:inherit; font-weight:400;
}
.dialog-form input:focus { outline:2px solid rgba(5,99,200,.2); border-color:var(--blue); }
.primary-action { min-height:46px; border:0; border-radius:10px; background:var(--blue); color:#fff; font:inherit; font-weight:800; cursor:pointer; }
.primary-action:hover { background:var(--blue-dark); }
.form-status { min-height:18px; color:var(--muted); font-size:13px; line-height:1.45; }

.purchase-dialog { width:min(620px, calc(100vw - 28px)); }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.form-grid .span-2 { grid-column:1 / -1; }
.payment-methods { margin:0; padding:14px; border:1px solid var(--line); border-radius:10px; display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.payment-methods legend { padding:0 6px; font-weight:800; }
.payment-methods label { display:flex; align-items:center; gap:8px; min-height:36px; cursor:pointer; }
.payment-methods input { width:auto; min-height:0; }

@media (max-width: 720px) {
  /* Match the Desktop logo start: 12px edge + 36px menu + 8px gap = 56px. */
  .site-header { gap:10px; padding-left:56px; padding-right:12px; }
  .brand-nav { gap:7px; }
  .header-logo-desktop { height:48px; }
  .header-logo-photobank { height:44px; }
  .login-button { padding:8px 10px; font-size:13px; }
  .login-button svg { display:none; }
  .form-grid, .payment-methods { grid-template-columns:1fr; }
  .form-grid .span-2 { grid-column:auto; }
  .dialog-form { padding:24px 18px 20px; }
}
@media (max-width: 420px) {
  .header-logo-desktop { height:42px; }
  .header-logo-photobank { height:38px; max-width:92px; }
}

/* Embedded Photo Library view inside the FullCator browser shell. */
body.fc-embed .site-header,
body.fc-embed .hero {
  display: none;
}
body.fc-embed main {
  min-height: 100vh;
}
body.fc-embed .catalog {
  padding-top: 18px;
}
