/*
 * Розміщення облікової системи у хмарі.
 *
 * Built from the same pieces as the other service pages — the cards, the
 * section headings, the CTA are the site's own. The one component of its own
 * is the comparison, because the argument of this service is a bill against a
 * single payment, and that reads as two columns or not at all.
 */

.sx-server__title {
	margin: 0;
	font-size: var( --sx-title-page );
	line-height: 1.1;
	letter-spacing: -0.02em;
	text-wrap: balance;
}

.sx-server__lead {
	margin: 14px 0 0;
	max-width: 68ch;
	font-size: 1.05rem;
	line-height: 1.6;
	color: var( --sx-text-secondary );
}

.sx-server__h2 {
	margin: var( --wp--preset--spacing--60 ) 0 var( --wp--preset--spacing--30 );
	font-size: var( --sx-title-section );
	line-height: 1.15;
	letter-spacing: -0.02em;
}

/* ---- Порівняння ----
   The list of costs on the left, the one payment on the right. Deliberately
   not a table: there is nothing to compare row by row, the point is a heap
   against a single line. */

.sx-server__compare {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	gap: 20px;
	align-items: stretch;
}

.sx-server__col {
	min-width: 0;
	padding: 26px 28px;
	border-radius: var( --sx-radius-lg );
}

.sx-server__col--own {
	background: var( --sx-surface );
	border: 1px solid var( --sx-border );
}

.sx-server__col--rent {
	background: var( --sx-brand-50 );
	border: 1px solid var( --sx-brand-200 );
}

.sx-server__col-title {
	margin: 0 0 14px;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var( --sx-text-muted );
}

.sx-server__col--rent .sx-server__col-title {
	color: var( --sx-brand-text );
}

.sx-server__col ul {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 9px;
}

.sx-server__col li {
	position: relative;
	padding-left: 24px;
	color: var( --sx-text-secondary );
	line-height: 1.45;
	overflow-wrap: break-word;
}

/* A small cross: each of these is a cost the rental removes. */
.sx-server__col li::before,
.sx-server__col li::after {
	content: "";
	position: absolute;
	left: 3px;
	top: 0.72em;
	width: 11px;
	height: 2px;
	background: var( --sx-text-muted );
	border-radius: 2px;
}

.sx-server__col li::before {
	transform: rotate( 45deg );
}

.sx-server__col li::after {
	transform: rotate( -45deg );
}

.sx-server__col-lead {
	margin: 0;
	font-family: var( --wp--preset--font-family--manrope, inherit );
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.01em;
	overflow-wrap: break-word;
}

.sx-server__col-text {
	margin: 12px 0 0;
	color: var( --sx-text-secondary );
	line-height: 1.55;
	overflow-wrap: break-word;
}

/* ---- Картки ---- */

.sx-server__grid {
	display: grid;
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	gap: 20px;
}

.sx-server__card {
	min-width: 0;
	padding: 24px 26px;
	background: var( --sx-white );
	border: 1px solid var( --sx-border );
	border-radius: var( --sx-radius-lg );
}

.sx-server__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	margin-bottom: 14px;
	border-radius: var( --sx-radius-md );
	background: var( --sx-brand-50 );
	color: var( --sx-brand-text );
}

.sx-server__icon svg {
	width: 22px;
	height: 22px;
}

.sx-server__card h3 {
	margin: 0 0 8px;
	font-size: 1.05rem;
	line-height: 1.3;
	overflow-wrap: break-word;
}

.sx-server__card p {
	margin: 0;
	color: var( --sx-text-muted );
	font-size: 0.95rem;
	line-height: 1.6;
	overflow-wrap: break-word;
}

/* ---- Тестовий доступ ---- */

.sx-server__try {
	padding: 28px 32px;
	background: var( --sx-surface );
	border-radius: var( --sx-radius-lg );
	border-left: 3px solid var( --sx-brand );
}

.sx-server__try p {
	margin: 0;
	max-width: 68ch;
	line-height: 1.6;
}

.sx-server__unit {
	margin-top: 12px !important;
	color: var( --sx-text-muted );
	font-size: 0.93rem;
}

.sx-server__try-cta {
	margin-top: 20px !important;
}

@media ( max-width: 900px ) {
	.sx-server__grid {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

@media ( max-width: 700px ) {
	.sx-server__compare,
	.sx-server__grid {
		grid-template-columns: minmax( 0, 1fr );
	}

	.sx-server__col,
	.sx-server__try {
		padding: 22px 20px;
	}
}

/* ---- Калькулятор ----
   Two steppers and a total. The tariff is two numbers, so a table of packages
   would be inventing tiers that do not exist. */

.sx-calc {
	padding: 28px 32px;
	background: var( --sx-surface );
	border-radius: var( --sx-radius-lg );
	border: 1px solid var( --sx-border );
}

.sx-calc__rates p {
	margin: 0;
	max-width: 62ch;
	color: var( --sx-text-secondary );
	line-height: 1.6;
}

.sx-calc__controls {
	display: flex;
	flex-wrap: wrap;
	gap: 24px 40px;
	margin: 24px 0 0;
	padding: 24px 0 0;
	border-top: 1px solid var( --sx-border );
}

.sx-calc__field label {
	display: block;
	margin-bottom: 8px;
	font-size: 0.85rem;
	font-weight: 600;
	color: var( --sx-text-secondary );
}

.sx-calc__stepper {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px;
	background: var( --sx-white );
	border: 1px solid var( --sx-border );
	border-radius: var( --sx-radius-pill, 999px );
}

.sx-calc__btn {
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var( --sx-brand );
	font-size: 1.2rem;
	line-height: 1;
	cursor: pointer;
	transition: background-color var( --sx-transition-fast ) var( --sx-ease );
}

@media ( hover: hover ) {
	.sx-calc__btn:hover {
		background: var( --sx-brand-50 );
	}
}

.sx-calc__btn:focus-visible {
	outline: 3px solid var( --sx-brand );
	outline-offset: -3px;
}

/* input[type=number] beats a bare class, so the selector is scoped. */
.sx-calc .sx-calc__input {
	/*
	 * Sized for two digits, which is as high as these counts go. At 62px the
	 * field was nearly as wide as a button to show the character "1", and the
	 * pill it sits in ran to 160px — most of the row on a phone.
	 */
	width: 40px;
	height: 40px;
	/*
	 * The theme gives every input a min-height, and a min-height beats a
	 * height: the field came out 52px inside 40px buttons and pushed the pill
	 * to 62px tall. Matched to the buttons it sits between instead.
	 */
	min-height: 40px;
	padding: 0;
	border: 0;
	background: transparent;
	text-align: center;
	font-family: var( --wp--preset--font-family--manrope, inherit );
	font-size: 1.05rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	-moz-appearance: textfield;
	appearance: textfield;
}

.sx-calc .sx-calc__input::-webkit-outer-spin-button,
.sx-calc .sx-calc__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.sx-calc__hint {
	margin: 8px 0 0;
	font-size: 0.82rem;
	color: var( --sx-text-muted );
}

.sx-calc__result {
	margin: 24px 0 0;
	padding: 22px 0 0;
	border-top: 1px solid var( --sx-border );
}

.sx-calc__eur {
	margin: 0;
	font-family: var( --wp--preset--font-family--manrope, inherit );
	font-size: 2.4rem;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
}

.sx-calc__per {
	margin-left: 6px;
	font-size: 1rem;
	font-weight: 600;
	color: var( --sx-text-muted );
}

.sx-calc__uah {
	margin: 8px 0 0;
	font-size: 1.15rem;
	font-weight: 600;
	color: var( --sx-text-secondary );
	font-variant-numeric: tabular-nums;
}

.sx-calc__rate {
	margin: 10px 0 0;
	max-width: 56ch;
	font-size: 0.85rem;
	line-height: 1.5;
	color: var( --sx-text-muted );
}

/*
 * Now a sibling of the calculator rather than its last line, so it takes the
 * calculator's own surface and border: white on white read as nothing at all
 * once it left the card it used to sit inside.
 */
.sx-calc__dedicated {
	margin: 16px 0 0;
	padding: 16px 20px;
	background: var( --sx-surface );
	border: 1px solid var( --sx-border );
	border-radius: var( --sx-radius-md );
	font-size: 0.95rem;
	line-height: 1.55;
	color: var( --sx-text-secondary );
}

.sx-calc__dedicated a {
	color: var( --sx-brand-text );
	font-weight: 600;
}

@media ( max-width: 700px ) {
	.sx-calc {
		padding: 18px 16px;
	}

	/*
	 * One field per line below this width.
	 *
	 * Left to wrap on its own, the two fields still fitted side by side at
	 * around 620-700px while already using the label-beside-stepper layout
	 * below — and because only the second field carries a hint, its grid has a
	 * row the first one lacks and the two steppers sat 12px apart. Stacking
	 * them makes the shape the same at every width the layout applies to.
	 */
	.sx-calc__controls {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}

	.sx-calc__eur {
		font-size: 2rem;
	}

	/*
	 * The calculator came to 956px on a 915px phone, so the price it works out
	 * sat below the fold — the one line the whole thing exists to show. Every
	 * measurement below is taken from spacing rather than from content: all
	 * five sections stay, and so does every control.
	 */

	/* Three dividers at 24px above and 24px below cost 144px between them. */
	.sx-calc__controls,
	.sx-calc__periods,
	.sx-calc__result {
		margin-top: 16px;
		padding-top: 16px;
	}

	/*
	 * Label beside its stepper instead of above it. "Користувачів" and a
	 * counter are a caption and its control, and there is room for both on one
	 * line; stacked they cost 26px each in a column that has none to spare.
	 * The hint keeps its own line underneath.
	 */
	.sx-calc__field {
		display: grid;
		grid-template-columns: 1fr auto;
		align-items: center;
		column-gap: 12px;
	}

	.sx-calc__field label {
		margin-bottom: 0;
	}

	.sx-calc__hint {
		grid-column: 1 / -1;
		margin-top: 4px;
	}

}

/* ---- Період ---- */

.sx-calc__periods {
	margin: 24px 0 0;
	padding: 24px 0 0;
	border: 0;
	border-top: 1px solid var( --sx-border );
}

.sx-calc__periods legend {
	padding: 0;
	margin-bottom: 10px;
	font-size: 0.85rem;
	font-weight: 600;
	color: var( --sx-text-secondary );
}

.sx-calc__period-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.sx-calc__period {
	position: relative;
	cursor: pointer;
}

/* The input stays in the accessibility tree and keeps keyboard control; the
   label beside it is what gets painted. */
.sx-calc__period input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.sx-calc__period span {
	display: block;
	padding: 11px 20px;
	background: var( --sx-white );
	border: 1px solid var( --sx-border );
	border-radius: var( --sx-radius-pill, 999px );
	font-weight: 600;
	white-space: nowrap;
	transition:
		background-color var( --sx-transition-fast ) var( --sx-ease ),
		border-color var( --sx-transition-fast ) var( --sx-ease ),
		color var( --sx-transition-fast ) var( --sx-ease );
}

@media ( hover: hover ) {
	.sx-calc__period:hover span {
		border-color: var( --sx-brand );
	}
}

.sx-calc__period input:checked + span {
	background: var( --sx-brand );
	border-color: var( --sx-brand );
	color: var( --sx-white );
}

.sx-calc__period input:focus-visible + span {
	outline: 3px solid var( --sx-brand );
	outline-offset: 2px;
}

/*
 * Four periods in one row rather than two by two, saving a row on a phone.
 *
 * Placed here rather than with the rest of the phone rules further up: a media
 * query adds no specificity, so the two rules it has to beat — the flex row and
 * the button padding above — would simply have won by coming later in the file.
 */
@media ( max-width: 700px ) {
	.sx-calc__period-row {
		display: grid;
		grid-template-columns: repeat( 4, minmax( 0, 1fr ) );
		gap: 6px;
	}

	.sx-calc__period span {
		padding: 10px 4px;
		font-size: 0.85rem;
		text-align: center;
	}
}

.sx-calc__buy {
	margin: 20px 0 0;
}

.sx-calc__add[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}
