/**
 * Custom Form — стилі адмінки
 * Version: 1.0.3
 * Самодостатній файл — не залежить від головного плагіну SOLASS.
 */

/* ---- Заголовок ---- */
.custom-form .cf-page-h1 {
	font-size: 23px;
	font-weight: 400;
	margin: 0 0 6px;
	color: #1d2327;
	display: flex;
	align-items: center;
	gap: 10px;
	line-height: 1.3;
}
.cf-version-badge {
	display: inline-block;
	background: #f0f6fc;
	color: #2271b1;
	border: 1px solid #b8d4f1;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 500;
	padding: 2px 10px;
	vertical-align: middle;
	line-height: 1.6;
}

/* ---- Утиліти ---- */
.custom-form .cf-align-right { text-align: right !important; }
.custom-form .cf-mt15        { margin-top: 15px; }
.custom-form .cf-disabled    { opacity: 0.4; pointer-events: none; }

/* ---- Таблиця — 6 колонок (3 пари th+td) ---- */
.custom-form .cf-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}

/* th — лейбл, фіксована вузька ширина */
.custom-form .cf-table th.cf-align-right {
	width: 13%;
	padding: 10px 12px 10px 0;
	font-size: 13px;
	font-weight: 500;
	color: #1d2327;
	text-align: right;
	vertical-align: top;
	white-space: nowrap;
}

/* td — поле, займає залишок у своїй парі */
.custom-form .cf-table td {
	width: 20%;
	padding: 8px 16px 8px 0;
	vertical-align: top;
	font-size: 13px;
	position: relative; /* для абсолютного пікера */
}

/* Розділювач рядків */
.custom-form .cf-table tr + tr th,
.custom-form .cf-table tr + tr td {
	border-top: 1px solid #f0f0f1;
}

/* Sizer — фіксує мінімальну ширину td щоб таблиця не "стрибала"
   (аналог <div style="width:200px"> з головного плагіну) */
.custom-form .cf-td-sizer {
	width: 160px;
	height: 0;
	overflow: hidden;
}

/* ---- Заголовок секції ---- */
.custom-form .cf-table h3 {
	margin: 16px 0 4px;
	padding: 0 0 8px;
	font-size: 14px;
	font-weight: 600;
	color: #1d2327;
	border-bottom: 1px solid #c3c4c7;
}

/* ---- Toggle switch (копія з головного плагіну, під .custom-form) ---- */
.custom-form .switch {
	position: relative;
	display: inline-block;
	width: 60px;
	height: 34px;
}
.custom-form .switch input {
	opacity: 0;
	width: 0;
	height: 0;
}
.custom-form .slider {
	position: absolute;
	cursor: pointer;
	top: 0; left: 0; right: 0; bottom: 0;
	background-color: #ccc;
	transition: .4s;
}
.custom-form .slider:before {
	position: absolute;
	content: "";
	height: 26px;
	width: 26px;
	left: 4px;
	bottom: 4px;
	background-color: #fff;
	transition: .4s;
}
.custom-form input:checked + .slider       { background-color: #73bf33; }
.custom-form input:checked + .slider:before { transform: translateX(26px); }
.custom-form .slider.round                  { border-radius: 34px; }
.custom-form .slider.round:before           { border-radius: 50%; }

/* ---- Color picker — абсолютний, не розвалює рядок таблиці ---- */
.custom-form .cf-color-td {
	vertical-align: middle;
}
.custom-form .wp-picker-container {
	display: inline-block;
}
.custom-form .wp-color-result.button {
	min-width: 120px;
}
/* Відкрита палітра Iris виводиться з потоку */
.custom-form .wp-picker-holder {
	position: absolute;
	z-index: 999;
	top: 100%;
	left: 0;
}

/* ---- Tooltip/hint (власна копія) ---- */
.custom-form .swp-hint {
	position: relative;
	z-index: 100;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	border: 1px solid #a0a0a0;
	border-radius: 50%;
	background: #fff;
	vertical-align: middle;
	cursor: help;
}
.custom-form .swp-hint::before {
	content: '?';
	color: #a0a0a0;
	font-weight: 600;
	font-size: 12px;
	line-height: 1;
}
.custom-form .swp-tooltip {
	position: absolute;
	z-index: 400;
	visibility: hidden;
	padding: 12px;
	width: 340px;
	border: 1px solid rgba(16,16,16,.1);
	border-radius: 4px;
	background: #fff;
	box-shadow: 0 2px 4px rgba(0,0,0,.05);
	color: #3c434b;
	font-size: 12px;
	line-height: 1.4;
	opacity: 0;
	transition: all .2s;
	white-space: normal;
}
.custom-form .swp-tooltip.swp-top { bottom: calc(100% + 10px); inset-inline-start: -10px; }
.custom-form :is(label,span,div,a):hover > .swp-tooltip { visibility: visible; opacity: 1; }

/* ---- Кнопки ---- */
.custom-form .button,
.custom-form .button-primary,
.custom-form .button-secondary {
	padding: 6px 20px;
	font-size: 13px;
}

/* ---- Адаптивність ---- */
@media screen and (max-width: 960px) {
	/* На вузьких екранах — 2 колонки замість 3 */
	.custom-form .cf-table th.cf-align-right { width: 18%; }
	.custom-form .cf-table td { width: 30%; }
}
@media screen and (max-width: 640px) {
	/* Мобільний — лінійно */
	.custom-form .cf-table,
	.custom-form .cf-table tbody,
	.custom-form .cf-table tr,
	.custom-form .cf-table th,
	.custom-form .cf-table td { display: block; width: 100%; text-align: left; }
	.custom-form .cf-table th.cf-align-right { padding-right: 0; white-space: normal; }
	.custom-form .cf-td-sizer { width: 100%; }
}

/* ---- Footer з кнопкою — скопійовано з solass-wp-settings ---- */
.custom-form footer.submit_footer {
  width: 100%;
  background-color: #f0f0f0;
  border-top: 1px solid #ccc;
  margin-left: -22px;
  padding-left: 20px;
  z-index: 9999;
  box-shadow: 0 0px 10px rgba(0,0,0,.15);
  opacity: 1;
  transition: all 0.5s ease;
  position: fixed;
}

.custom-form footer.submit_footer input {
  padding: 5px 25px !important;
}

.custom-form footer.submit_footer p.submit {
  margin-top: 10px;
  padding-bottom: 12px;
}

#wpfooter { position: static !important; }

/* ---- Кнопка — оранжева, як у головному плагіні ---- */
.custom-form .button-primary,
.custom-form .button-secondary {
  padding: 10px 25px !important;
  font-size: 15px;
}
.custom-form .button-primary {
  background: #eb6608;
  border-color: #eb6608;
  color: #fff;
  text-decoration: none;
  text-shadow: none;
}
.custom-form .button-primary:hover,
.custom-form .button-primary:focus {
  background: #d05a07;
  border-color: #d05a07;
  color: #fff;
}

/* ---- valign_text — для тексту поруч з кнопкою ---- */
.custom-form .valign_text {
  top: 50% !important;
  transform: translate(0, -50%) !important;
  position: absolute;
}
