:root{
  --bg:#F2F4F7;
  --card:#ffffff;

  --text:#050505;
  --muted:#65676B;

  --primary:#1877F2;
  --primary-hover:#166FE5;

  --danger:#E41E3F;

  --border:#DADDE1;
  --input-border:#CCD0D5;

  --shadow: 0 1px 2px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.06);
  --radius:12px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background: var(--bg);
}

.container{
  width: min(980px, 92vw);
  margin: 0 auto;
  padding: 28px 0 40px;
}

.header{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  align-items:flex-end;
  justify-content:space-between;
  margin-bottom:18px;
}

.header.header-center{
  justify-content:center;
  align-items:center;
  text-align:center;
}

.brand h1{
  font-size: clamp(20px, 3.2vw, 34px);
  line-height:1.1;
  margin:0;
  letter-spacing:0.1px;
}

.brand p{
  margin:8px 0 0;
  color:var(--muted);
  font-size:14px;
}

.brand.brand-center{ width:100%; }

.card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.card-head{
  padding:18px 18px 14px;
  border-bottom:1px solid var(--border);
}

.card-head .title{
  margin:0;
  font-size:16px;
  color:var(--text);
}

.card-body{ padding:18px; }

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

.field label{
  display:block;
  font-size:13px;
  color:var(--muted);
  margin:0 0 6px;
}

.field input,
.field textarea,
.field select{
  width:100%;
  padding:12px 12px;
  border-radius:10px;
  border:1px solid var(--input-border);
  background:#ffffff;
  color:var(--text);
  outline:none;
}

.field input::placeholder,
.field textarea::placeholder{
  color:#8A8D91;
}

.field input:focus,
.field textarea:focus,
.field select:focus{
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24,119,242,0.18);
}

.field textarea{min-height:90px; resize:vertical}

.help{
  margin-top:6px;
  font-size:12px;
  color:var(--muted);
}

.error{
  margin-top:6px;
  font-size:12px;
  color: var(--danger);
}

.input-error{
  border-color: rgba(228,30,63,0.85) !important;
  box-shadow: 0 0 0 3px rgba(228,30,63,0.14) !important;
}

.section{ margin-top:16px; }

.radio-list{ display:grid; gap:10px; }
.radio-list:has(.delivery-group){ gap:0; }
.radio-list-error{ outline: 2px solid rgba(228,30,63,0.75); outline-offset: 4px; border-radius:14px; box-shadow: 0 0 0 4px rgba(228,30,63,0.10); }

.delivery-group{ display:grid; gap:10px; }
.delivery-group + .delivery-group{ margin-top:18px; }

.radio{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding:12px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#ffffff;
}

.radio input{ margin-top:3px; }

.radio .r-title{
  font-size:14px;
  margin:0;
  color:var(--text);
}

.radio .r-sub{
  font-size:12px;
  color:var(--muted);
  margin:4px 0 0;
}

.point-inline{
  margin-top:10px;
  overflow:hidden;
  max-height:0;
  opacity:0;
  transform: translateY(-6px);
  transition: max-height 260ms ease, opacity 220ms ease, transform 220ms ease;
  will-change: max-height, opacity, transform;
}

.point-inline.is-open{
  max-height:600px;
  opacity:1;
  transform: translateY(0);
  overflow:visible;
}

/* Autocomplete */
.ac-wrap{
  position:relative;
  width:100%;
  margin-top:10px;
}

.ac-label{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin-bottom:6px;
}

.ac-input-row{
  display:flex;
  align-items:center;
  position:relative;
}

.ac-input{
  width:100%;
  padding:10px 36px 10px 12px;
  border-radius:10px;
  border:1px solid var(--input-border);
  background:#ffffff;
  color:var(--text);
  outline:none;
  font-size:14px;
  font-family:var(--font);
}

.ac-input::placeholder{ color:#8A8D91; }

.ac-input:focus{
  border-color:var(--primary);
  box-shadow: 0 0 0 3px rgba(24,119,242,0.18);
}

.ac-spinner{
  position:absolute;
  right:10px;
  top:50%;
  transform:translateY(-50%);
  width:16px;
  height:16px;
  border:2px solid var(--border);
  border-top-color:var(--primary);
  border-radius:50%;
  animation:ac-spin 0.6s linear infinite;
  display:none;
  pointer-events:none;
}

.ac-spinner.is-active{ display:block; }

@keyframes ac-spin{ to{ transform:translateY(-50%) rotate(360deg); } }

.ac-dropdown{
  position:absolute;
  top:calc(100% + 4px);
  left:0;
  right:0;
  background:#ffffff;
  border:1px solid var(--border);
  border-radius:10px;
  box-shadow:0 4px 20px rgba(0,0,0,0.14);
  z-index:200;
  max-height:250px;
  overflow-y:auto;
  display:none;
}

.ac-dropdown.is-open{ display:block; }

.ac-item{
  padding:10px 12px;
  cursor:pointer;
  border-bottom:1px solid var(--border);
  font-size:13px;
}

.ac-item:last-child{ border-bottom:none; }
.ac-item:hover{ background:#F2F4F7; }

.ac-item-code{
  font-weight:650;
  color:var(--text);
}

.ac-item-addr{
  font-size:11px;
  color:var(--muted);
  margin-top:2px;
}

.ac-empty{
  padding:10px 12px;
  font-size:13px;
  color:var(--muted);
  text-align:center;
}


.point-inline-inner{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

.point-inline .help{ margin-top:0; }

.actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:center;
  margin-top:18px;
}

.btn{
  appearance:none;
  border:none;
  cursor:pointer;
  padding:12px 16px;
  border-radius:12px;
  font-weight:650;
  letter-spacing:0.1px;
  display:inline-flex;
  gap:10px;
  align-items:center;
  justify-content:center;
  transition: transform 0.06s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:active{ transform: translateY(1px); }

.btn-primary{
  background: var(--primary);
  color:#ffffff;
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

.btn-primary:hover{ background: var(--primary-hover); }
.btn-primary:disabled{ opacity:0.6; cursor:not-allowed; }

.btn-ghost{
  background: #E4E6EB;
  color: var(--text);
  border:1px solid rgba(0,0,0,0.04);
}

.btn-ghost:hover{ background:#D8DADF; }

.badge{
  display:inline-flex;
  align-items:center;
  padding:4px 10px;
  border-radius:999px;
  font-size:14px;
font-weight: bold;
  color: var(--text);
}

.badge.ok{
  border-color: rgba(45,136,255,0.22);
  background: rgba(24,119,242,0.10);
}

/* Popup (centrum ekranu) */
.popup-root{ position:fixed; inset:0; z-index:9999; display:none; }
.popup-root.is-open{ display:block; }
.popup-backdrop{ position:absolute; inset:0; background: rgba(15,23,42,0.55); }
.popup-card{
  position:absolute;
  left:50%;
  top:50%;
  transform: translate(-50%,-50%);
  width: min(520px, calc(100vw - 28px));
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,0.14);
  box-shadow: 0 10px 35px rgba(0,0,0,0.25);
  background: #ffffff;
  padding: 16px 16px 14px;
  text-align:center;
}
.popup-icon{
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin: 2px auto 10px;
  font-weight: 900;
  font-size: 24px;
}
.popup-root.is-error .popup-icon{ background: rgba(228,30,63,0.14); color: var(--danger); }
.popup-root.is-success .popup-icon{ background: rgba(34,197,94,0.16); color: #16a34a; }
.popup-root.is-info .popup-icon{ background: rgba(24,119,242,0.14); color: var(--primary); }
.popup-title{ font-weight: 800; font-size: 15px; margin: 0 0 6px; }
.popup-text{ font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.popup-list{ text-align:left; background:#F7F8FA; border:1px solid rgba(15,23,42,0.10); border-radius: 14px; padding:10px 12px; margin: 8px 0 10px; }
.popup-list-title{ font-size:12px; color: var(--muted); margin-bottom:6px; }
.popup-list ul{ margin:0; padding-left: 18px; }
.popup-list li{ font-size: 12px; color: var(--text); margin: 2px 0; }
.popup-actions{ display:flex; justify-content:center; }
.popup-btn{
  appearance:none;
  border: 1px solid rgba(15,23,42,0.12);
  background: #ffffff;
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 750;
  cursor:pointer;
}
.popup-root.is-success .popup-btn{ background: rgba(34,197,94,0.10); border-color: rgba(34,197,94,0.25); }
.popup-root.is-error .popup-btn{ background: rgba(228,30,63,0.08); border-color: rgba(228,30,63,0.25); }
.popup-root.is-info .popup-btn{ background: rgba(24,119,242,0.08); border-color: rgba(24,119,242,0.22); }

.small-link{
  color: var(--primary);
  text-decoration:none;
}

.small-link:hover{ text-decoration:underline; }

.hr{
  height:1px;
  background: var(--border);
  margin:16px 0;
}

.check-row{ margin-top:6px; }

.check{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding:12px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#ffffff;
}

.check input{
  margin-top:3px;
  transform: scale(1.05);
}

.check span{
  font-size:13px;
  color: var(--text);
}

.footer{
  margin-top:14px;
  padding: 14px 6px 0;
  display:flex;
  flex-direction:column;
  gap:8px;
  align-items:center;
  text-align:center;
  color: var(--muted);
  font-size:12px;
}

.footer-note{
  max-width: 820px;
}

/* --- Logos w radioboxach --- */
.radio{
  align-items:center;
}

.radio input{
  margin-top:0;
}

.radio .r-main{
  display:flex;
  gap:12px;
  align-items:center;
}

.carrier-logo{
  width:44px;
  height:44px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#ffffff;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
  display:flex;
  align-items:center;
  justify-content:center;
  flex: 0 0 44px;
  overflow:hidden;
}

.carrier-logo img{
  width: 34px;
  height: 34px;
  object-fit:contain;
  display:block;
}

/* delikatne podbicie po najechaniu jak FB */
.radio:hover{
  background:#F7F8FA;
  transition: background-color 160ms ease;
}

.radio input:checked + .r-main .carrier-logo{
  border-color: rgba(24,119,242,0.35);
  box-shadow: 0 0 0 3px rgba(24,119,242,0.10);
}

@media (max-width: 520px){
  .carrier-logo{ width:40px; height:40px; flex-basis:40px; }
  .carrier-logo img{ width:30px; height:30px; }
}