/**
 * Add-server page for the PocketMine monitoring shell.
 * Scope: .mp-add only, so nothing leaks into other /servera/ pages.
 */

.mp-add {
	--mp-add-green: var(--game-bg-target, #2c9830);
	--mp-add-green-dark: #247a27;
	--mp-add-green-soft: #eef7ef;
	--mp-add-ink: #1a211d;
	--mp-add-text: #3d4741;
	--mp-add-muted: #6c7a72;
	--mp-add-line: #e3e9e5;
	--mp-add-line-strong: #cfd9d2;
	--mp-add-card: #fff;
	--mp-add-radius: 14px;
	max-width: 940px;
	margin: 0 auto;
	padding: 0 0 28px;
	color: var(--mp-add-text);
	font-size: 14px;
	line-height: 1.5;
}

.mp-add *,
.mp-add *::before,
.mp-add *::after {
	box-sizing: border-box;
}

.mp-add img {
	max-width: 100%;
}

.mp-add [hidden] {
	display: none !important;
}

.mp-add-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* Breadcrumbs */
.mp-add-crumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 7px;
	margin: 2px 0 12px;
	font-size: 12.5px;
	color: var(--mp-add-muted);
}

.mp-add-crumbs a {
	color: inherit;
	text-decoration: none;
}

.mp-add-crumbs a:hover {
	color: var(--mp-add-green);
	text-decoration: underline;
}

.mp-add-crumbs__sep {
	opacity: .5;
}

.mp-add-crumbs__cur {
	color: #3f4a44;
}

/* Page header */
.mp-add-head {
	position: relative;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	margin: 0 0 16px;
	padding: 22px 24px;
	border: 1px solid var(--mp-add-line);
	border-radius: 16px;
	background:
		radial-gradient(120% 150% at 100% 0, rgba(44, 152, 48, .10) 0, rgba(44, 152, 48, 0) 55%),
		#fff;
	box-shadow: 0 1px 2px rgba(20, 35, 26, .04);
	overflow: hidden;
}

.mp-add-head::after {
	content: "";
	position: absolute;
	right: -46px;
	bottom: -66px;
	width: 190px;
	height: 190px;
	border-radius: 50%;
	background: rgba(44, 152, 48, .05);
	pointer-events: none;
}

.mp-add-head__text {
	position: relative;
	z-index: 1;
	min-width: 0;
}

.mp-add-head h1 {
	margin: 0 0 7px;
	font-size: 27px;
	line-height: 1.2;
	font-weight: 700;
	letter-spacing: -.02em;
	color: var(--mp-add-ink);
}

.mp-add-head p {
	max-width: 620px;
	margin: 0;
	color: var(--mp-add-muted);
	font-size: 14px;
}

.mp-add-head__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin-top: 12px;
	font-size: 12.5px;
	color: #4c5a52;
}

.mp-add-head__meta span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.mp-add-head__meta i {
	color: var(--mp-add-green);
}

.mp-add-head__back {
	position: relative;
	z-index: 1;
	flex: none;
}

/* Buttons */
.mp-add .mp-add-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: auto;
	max-height: none;
	height: 44px;
	padding: 0 20px;
	border: 1px solid transparent;
	border-radius: 10px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	opacity: 1;
	transition: background .18s, border-color .18s, color .18s, transform .12s, box-shadow .18s;
}

.mp-add .mp-add-btn:hover {
	opacity: 1;
}

.mp-add-btn:focus-visible {
	outline: 2px solid rgba(44, 152, 48, .45);
	outline-offset: 2px;
}

.mp-add .mp-add-btn--primary {
	background: var(--mp-add-green);
	color: #fff;
	box-shadow: 0 1px 2px rgba(20, 60, 25, .18), inset 0 -2px 0 rgba(0, 0, 0, .12);
}

.mp-add .mp-add-btn--primary:hover {
	background: var(--mp-add-green-dark);
	color: #fff;
}

.mp-add .mp-add-btn--primary:active {
	transform: translateY(1px);
}

.mp-add .mp-add-btn--ghost {
	background: #fff;
	border-color: var(--mp-add-line-strong);
	color: #37433b;
}

.mp-add .mp-add-btn--ghost:hover {
	border-color: var(--mp-add-green);
	background: #fbfefb;
	color: var(--mp-add-green);
}

/* Alerts */
.mp-add-alert {
	display: flex;
	align-items: flex-start;
	gap: 11px;
	margin: 0 0 14px;
	padding: 13px 15px;
	border: 1px solid;
	border-radius: 12px;
	font-size: 13px;
	line-height: 1.5;
}

.mp-add-alert__ico {
	display: grid;
	place-items: center;
	flex: none;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	font-size: 12px;
}

.mp-add-alert__body {
	min-width: 0;
}

.mp-add-alert__body b {
	display: block;
	margin-bottom: 3px;
	font-size: 13.5px;
}

.mp-add-alert__body p {
	margin: 3px 0 0;
}

.mp-add-alert ul {
	display: flex;
	flex-direction: column;
	gap: 3px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mp-add-alert li {
	position: relative;
	padding-left: 12px;
}

.mp-add-alert li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .58em;
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: currentColor;
	opacity: .55;
}

.mp-add-alert a {
	color: inherit;
	font-weight: 600;
	text-decoration: underline;
}

.mp-add-alert--err {
	background: #fdf3f2;
	border-color: #f0d1cc;
	color: #8f342b;
}

.mp-add-alert--err .mp-add-alert__ico {
	background: #f7dcd8;
	color: #a53a30;
}

.mp-add-alert--ok {
	background: #f0faf2;
	border-color: #c9e8d0;
	color: #215f32;
}

.mp-add-alert--ok .mp-add-alert__ico {
	background: #d9f1df;
	color: #237a3a;
}

/* Form layout */
.mp-add-form {
	margin: 0;
}

.mp-add-stack {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.mp-add-card {
	min-width: 0;
	border: 1px solid var(--mp-add-line);
	border-radius: var(--mp-add-radius);
	background: var(--mp-add-card);
	box-shadow: 0 1px 2px rgba(20, 35, 26, .035);
	overflow: hidden;
}

.mp-add-card__head {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 17px 20px 0;
}

.mp-add-card__ico {
	display: grid;
	place-items: center;
	flex: none;
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: var(--mp-add-green-soft);
	color: var(--mp-add-green);
	font-size: 16px;
}

.mp-add-card__titles {
	min-width: 0;
}

.mp-add-card h2 {
	margin: 1px 0 3px;
	font-size: 16.5px;
	line-height: 1.3;
	font-weight: 700;
	letter-spacing: -.01em;
	color: var(--mp-add-ink);
}

.mp-add-card__titles p {
	margin: 0;
	font-size: 13px;
	color: var(--mp-add-muted);
}

.mp-add-card__body {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 16px 20px 20px;
}

/* Fields */
.mp-add-field,
.mp-add-choices-field,
.mp-add-cats-field {
	display: flex;
	flex-direction: column;
	gap: 7px;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.mp-add-row {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	gap: 14px;
}

.mp-add-label {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: .01em;
	color: #344038;
}

.mp-add-label em {
	font-style: normal;
	font-weight: 700;
	color: #c95246;
}

.mp-add .mp-add-input {
	width: 100%;
	max-width: 100%;
	height: 44px;
	min-height: 44px;
	padding: 0 13px;
	border: 1px solid var(--mp-add-line-strong);
	border-radius: 10px;
	background: #fff;
	color: var(--mp-add-ink);
	font: inherit;
	font-size: 14px;
	box-shadow: none;
	transition: border-color .15s, box-shadow .15s, background .15s;
}

.mp-add .mp-add-input::placeholder {
	color: #9aa8a0;
}

.mp-add .mp-add-input:hover {
	border-color: #b9c7bf;
}

.mp-add .mp-add-input:focus {
	outline: none;
	border-color: var(--mp-add-green);
	background: #fff;
	box-shadow: 0 0 0 3px rgba(44, 152, 48, .13);
}

.mp-add textarea.mp-add-input {
	height: auto;
	min-height: 112px;
	padding: 11px 13px;
	line-height: 1.5;
	resize: vertical;
}

.mp-add-field__meta {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	font-size: 11.5px;
	line-height: 1.4;
	color: #8b9891;
}

.mp-add-select {
	position: relative;
	display: block;
}

.mp-add .mp-add-select select {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 40px;
	cursor: pointer;
	box-shadow: none;
}

.mp-add-select::after {
	content: "";
	position: absolute;
	right: 15px;
	top: 50%;
	width: 8px;
	height: 8px;
	border-right: 2px solid #7c8a82;
	border-bottom: 2px solid #7c8a82;
	transform: translateY(-68%) rotate(45deg);
	pointer-events: none;
}

.mp-add-note {
	margin: 0;
	font-size: 12.5px;
	color: var(--mp-add-muted);
}

/* Platform radio cards */
.mp-add-choices {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.mp-add-choice {
	position: relative;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
	padding: 13px 14px;
	border: 1px solid var(--mp-add-line-strong);
	border-radius: 12px;
	background: #fff;
	cursor: pointer;
	transition: border-color .18s, background .18s, box-shadow .18s;
}

.mp-add-choice input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.mp-add-choice:hover {
	border-color: #b9c7bf;
	background: #fcfefc;
}

.mp-add-choice:has(input:checked) {
	border-color: var(--mp-add-green);
	background: var(--mp-add-green-soft);
	box-shadow: inset 0 0 0 1px var(--mp-add-green);
}

.mp-add-choice:has(input:focus-visible) {
	outline: 2px solid rgba(44, 152, 48, .4);
	outline-offset: 2px;
}

.mp-add-choice__ico {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: #f1f5f2;
	color: #5c6b62;
	font-size: 16px;
	transition: background .18s, color .18s;
}

.mp-add-choice:has(input:checked) .mp-add-choice__ico {
	background: #fff;
	color: var(--mp-add-green);
}

.mp-add-choice__body {
	min-width: 0;
}

.mp-add-choice__body b {
	display: block;
	font-size: 14px;
	color: var(--mp-add-ink);
}

.mp-add-choice__body small {
	display: block;
	margin-top: 2px;
	font-size: 11.5px;
	line-height: 1.35;
	color: var(--mp-add-muted);
}

.mp-add-choice__dot {
	flex: none;
	width: 18px;
	height: 18px;
	border: 2px solid #c5d0c9;
	border-radius: 50%;
	background: #fff;
	transition: border-color .18s, background .18s, box-shadow .18s;
}

.mp-add-choice:has(input:checked) .mp-add-choice__dot {
	border-color: var(--mp-add-green);
	background: var(--mp-add-green);
	box-shadow: inset 0 0 0 3px #fff;
}

/* Categories */
.mp-add-cats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
}

.mp-add-cat {
	position: relative;
	min-width: 0;
	cursor: pointer;
}

.mp-add-cat input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.mp-add-cat > span {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 38px;
	padding: 8px 10px 8px 11px;
	border: 1px solid var(--mp-add-line-strong);
	border-radius: 9px;
	background: #fff;
	color: #3f4a44;
	font-size: 12.5px;
	line-height: 1.25;
	overflow-wrap: anywhere;
	transition: border-color .15s, background .15s, color .15s;
}

.mp-add-cat > span::before {
	content: "";
	flex: none;
	width: 15px;
	height: 15px;
	border: 1.5px solid #c3cfc7;
	border-radius: 4px;
	background: #fff;
	transition: border-color .15s, background .15s;
}

.mp-add-cat:hover > span {
	border-color: #b9c7bf;
	background: #fcfefc;
}

.mp-add-cat input:checked + span {
	border-color: var(--mp-add-green);
	background: var(--mp-add-green-soft);
	color: #1f5c25;
	font-weight: 600;
}

.mp-add-cat input:checked + span::before {
	border-color: var(--mp-add-green);
	background: var(--mp-add-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10' fill='none'%3E%3Cpath d='M1 5.2 4.4 8.6 11 1.6' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px 8px no-repeat;
}

.mp-add-cat input:focus-visible + span {
	outline: 2px solid rgba(44, 152, 48, .4);
	outline-offset: 2px;
}

.mp-add-cat.is-hidden {
	display: none;
}

.mp-add-cats__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 12px;
}

.mp-add-cats__count {
	font-size: 12px;
	color: var(--mp-add-muted);
	font-variant-numeric: tabular-nums;
}

.mp-add-cats__count.is-over {
	color: #b03a2e;
	font-weight: 600;
}

.mp-add .mp-add-more {
	display: inline-flex;
	align-items: center;
	justify-content: flex-start;
	gap: 7px;
	width: auto;
	max-height: none;
	height: auto;
	padding: 4px 2px;
	border: 0;
	border-radius: 0;
	background: none;
	color: var(--mp-add-green);
	font: inherit;
	font-size: 12.5px;
	font-weight: 600;
	opacity: 1;
	cursor: pointer;
}

.mp-add .mp-add-more:hover {
	opacity: 1;
}

.mp-add-more i {
	font-size: 10px;
	transition: transform .18s;
}

.mp-add-more.is-open i {
	transform: rotate(180deg);
}

.mp-add-more:focus-visible {
	outline: 2px solid rgba(44, 152, 48, .45);
	outline-offset: 2px;
	border-radius: 5px;
}

/* File fields */
.mp-add-files {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.mp-add-file {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	padding: 12px;
	border: 1.5px dashed #cfdad3;
	border-radius: 12px;
	background: #fbfdfb;
	cursor: pointer;
	transition: border-color .18s, background .18s;
}

.mp-add-file:hover {
	border-color: var(--mp-add-green);
	background: #f7fcf8;
}

.mp-add-file:has(input:focus-visible) {
	outline: 2px solid rgba(44, 152, 48, .4);
	outline-offset: 2px;
}

.mp-add-file input {
	position: absolute;
	inset: 0;
	z-index: 2;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.mp-add-file__prev {
	position: relative;
	display: grid;
	place-items: center;
	flex: none;
	width: 56px;
	height: 56px;
	border-radius: 9px;
	background: #eef4ef;
	color: #87968c;
	font-size: 17px;
	overflow: hidden;
}

.mp-add-file__prev img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mp-add-file__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.mp-add-file__body b {
	font-size: 13.5px;
	color: var(--mp-add-ink);
}

.mp-add-file__body small {
	font-size: 11.5px;
	line-height: 1.3;
	color: var(--mp-add-muted);
}

.mp-add-file__name {
	max-width: 100%;
	margin-top: 2px;
	overflow: hidden;
	color: #7f8d85;
	font-size: 11.5px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mp-add-file__btn {
	flex: none;
	margin-left: auto;
	padding: 6px 10px;
	border: 1px solid var(--mp-add-line-strong);
	border-radius: 7px;
	background: #fff;
	color: #46534b;
	font-size: 11.5px;
	font-weight: 600;
}

/* Actions */
.mp-add-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	padding-top: 2px;
}

.mp-add-actions .mp-add-btn {
	min-width: 132px;
}

.mp-add-actions__note {
	margin-right: auto;
	color: var(--mp-add-muted);
	font-size: 12px;
}

.mp-add-actions__note i {
	margin-right: 3px;
	color: var(--mp-add-green);
}

/* Mobile */
@media (max-width: 767px) {
	.mp-add {
		padding: 12px 14px 26px;
	}

	.mp-add-head {
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
		padding: 18px 16px;
		border-radius: 14px;
	}

	.mp-add-head h1 {
		font-size: 22px;
	}

	.mp-add-head__back {
		width: 100%;
	}

	.mp-add-card__head {
		padding: 15px 15px 0;
	}

	.mp-add-card__body {
		padding: 14px 15px 16px;
	}

	.mp-add-row {
		grid-template-columns: 1fr;
	}

	.mp-add-choices {
		grid-template-columns: 1fr;
	}

	.mp-add-cats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.mp-add-files {
		grid-template-columns: 1fr;
	}

	.mp-add-actions {
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
	}

	.mp-add-actions .mp-add-btn {
		width: 100%;
		min-width: 0;
	}

	.mp-add-actions__note {
		display: none;
	}
}

@media (max-width: 430px) {
	.mp-add {
		padding: 10px 10px 24px;
	}

	.mp-add-head {
		padding: 16px 14px;
	}

	.mp-add-head h1 {
		font-size: 20px;
	}

	.mp-add-cats {
		grid-template-columns: 1fr;
	}

	.mp-add-file__btn {
		display: none;
	}
}
