/* Shared modal */

body.modal-open {
	overflow: hidden;
}

.modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 1100;

	display: flex;
	align-items: center;
	justify-content: center;

	padding: 24px;
	background: rgba(0, 34, 35, 0.78);
	backdrop-filter: blur(6px);
	box-sizing: border-box;
}

.modal-overlay[hidden] {
	display: none;
}

.modal-card {
	position: relative;

	width: min(420px, 100%);
	max-height: calc(100dvh - 48px);
	padding: 32px;
	overflow-y: auto;

	background: linear-gradient(
		180deg,
		rgba(0, 70, 71, 0.98) 0%,
		rgba(0, 48, 49, 0.98) 100%
	);
	color: var(--text-main);

	border: 1px solid var(--panel-border);
	border-radius: 18px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.38);
	box-sizing: border-box;
}

.modal-close {
	position: absolute;
	top: 12px;
	right: 14px;

	display: inline-flex;
	align-items: center;
	justify-content: center;

	width: 36px;
	height: 36px;
	padding: 0;

	background: transparent;
	color: var(--text-muted);
	border: none;
	border-radius: 50%;

	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	transition:
		background 0.2s ease,
		color 0.2s ease;
}

.modal-close:hover {
	background: rgba(255, 255, 255, 0.1);
	color: var(--accent);
}

.modal-close:focus-visible,
.modal-input:focus-visible,
.modal-submit:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 3px;
}

.modal-kicker {
	margin-bottom: 4px;

	color: var(--accent);
	font-family: "SonsCondensedExtrabold", Arial, sans-serif;
	font-size: 2.2rem;
	letter-spacing: 0.04em;
}

.modal-title {
	margin: 0 0 12px;

	color: var(--text-main);
	font-family: "SonsCondensedExtrabold", Arial, sans-serif;
	font-size: 1.5rem;
	letter-spacing: 0.02em;
}

.modal-description {
	margin: 0 0 24px;

	color: var(--text-muted);
	font-size: 0.95rem;
	line-height: 1.55;
}

.modal-label {
	display: block;
	margin-bottom: 8px;

	color: var(--text-main);
	font-size: 0.9rem;
	font-weight: 700;
}

.modal-input {
	width: 100%;
	padding: 13px 14px;

	background: #ffffff;
	color: #1a1a1a;
	border: 1px solid rgba(200, 255, 8, 0.48);
	border-radius: 10px;

	font: inherit;
	box-sizing: border-box;
}

.modal-input:focus-visible {
	border-color: var(--accent);
}

.modal-submit {
	width: 100%;
	margin-top: 16px;
	padding: 13px 18px;

	background: #ffffff;
	color: #001f20;
	border: none;
	border-radius: 999px;

	font-family: "SonsCondensedExtrabold", Arial, sans-serif;
	font-size: 1rem;
	cursor: pointer;
	transition:
		transform 0.2s ease,
		background 0.2s ease;
}

.modal-submit:hover {
	background: var(--accent-hover);
	transform: translateY(-1px);
}

.modal-submit:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	transform: none;
}

.modal-feedback {
	margin-top: 12px;
	padding: 10px 12px;

	border: 1px solid transparent;
	border-radius: 10px;

	font-size: 0.92rem;
	line-height: 1.45;
}

.modal-feedback[hidden] {
	display: none;
}

.modal-feedback.is-error {
	background: rgba(255, 118, 118, 0.14);
	border-color: rgba(255, 118, 118, 0.3);
	color: #ffd1d1;
}

.modal-feedback.is-success {
	background: rgba(117, 202, 100, 0.14);
	border-color: rgba(117, 202, 100, 0.3);
	color: #d6ffd0;
}

@media (max-width: 640px) {
	.modal-overlay {
		padding: 16px;
	}

	.modal-card {
		max-height: calc(100dvh - 32px);
		padding: 24px 20px;
		border-radius: 14px;
	}

	.modal-kicker {
		padding-right: 36px;
		font-size: 1.9rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.modal-close,
	.modal-submit {
		transition: none;
	}
}

/* Modal sizes */

.modal-card.wide {
width: min(880px, 100%);
}

/* Modal forms */

.modal-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 12px 14px;
}

.modal-field {
display: flex;
flex-direction: column;
gap: 6px;
min-width: 0;
}

.modal-field.full-width {
grid-column: 1 / -1;
}

.modal-required {
margin-left: 2px;
color: #ff6b6b;
}

.modal-select,
.modal-textarea {
width: 100%;
padding: 10px 12px;
background: #ffffff;
color: #1a1a1a;
border: 1px solid rgba(200, 255, 8, 0.48);
border-radius: 10px;
font: inherit;
box-sizing: border-box;
}

.modal-textarea {
min-height: 204px;
resize: vertical;
}

.modal-input:focus-visible,
.modal-select:focus-visible,
.modal-textarea:focus-visible {
border-color: var(--accent);
outline: 3px solid var(--accent);
outline-offset: 3px;
}

.modal-input.readonly {
background: rgba(117, 202, 100, 0.2);
color: var(--text-main);
border-color: rgba(117, 202, 100, 0.5);
}

.modal-help {
margin: 8px 0 0;
color: var(--text-muted);
font-size: 0.82rem;
line-height: 1.4;
}

/* Modal actions */

.modal-actions {
display: flex;
justify-content: flex-end;
gap: 12px;
margin-top: 12px;
}

.modal-action-btn {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 45px;
padding: 0 24px;
border: none;
border-radius: 999px;
font-family: "SonsCondensedExtrabold", Arial, sans-serif;
font-size: 1.2rem;
line-height: 1;
cursor: pointer;
transition:
background 0.2s ease,
transform 0.2s ease;
}

.modal-action-btn.primary {
background: var(--accent);
color: #001f20;
}

.modal-action-btn.secondary {
background: #ffffff;
color: #001f20;
}

.modal-action-btn:hover:not(:disabled) {
background: var(--accent-hover);
transform: translateY(-1px);
}

.modal-action-btn:disabled {
opacity: 0.55;
cursor: not-allowed;
transform: none;
}

.modal-action-btn:focus-visible {
outline: 3px solid var(--accent);
outline-offset: 3px;
}

@media (max-width: 760px) {
.modal-grid {
grid-template-columns: 1fr;
}

.modal-actions {
align-items: stretch;
}

.modal-action-btn {
flex: 1;
}
}

@media (prefers-reduced-motion: reduce) {
.modal-action-btn {
transition: none;
}
}

/* Extra-wide modals */

.modal-card.extra-wide {
	width: min(1120px, 100%);
}

.modal-card.medium {
	width: min(620px, 100%);
}

.modal-card.light {
	background: #ffffff;
	color: #1a1a1a;
	border-color: rgba(0, 0, 0, 0.12);
}

.modal-card.light .modal-title,
.modal-card.light .modal-label {
	color: #0b4f50;
}

.modal-card.light .modal-description,
.modal-card.light .modal-help {
	color: #666666;
}

.design-dialog-divider {
	height: 2px;
	margin: 28px 0 24px;
	background: rgba(255, 255, 255, 0.32);
	border-radius: 999px;
}

/* Download license modal */

.license-modal-body {
	max-height: calc(100dvh - 220px);
	margin: 0;
	padding: 24px;
	overflow-y: auto;
	background: #ffffff;
	color: #1a1a1a;
	border-radius: 14px;
}

.license-section {
	margin-bottom: 24px;
	padding-bottom: 24px;
	color: #1a1a1a;
	font-size: 0.95rem;
	line-height: 1.6;
	border-bottom: 1px solid rgba(0, 0, 0, 0.14);
}

.license-section:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.license-section:last-child {
	margin-bottom: 0;
}

.license-section h4 {
	margin: 0 0 10px;
	color: #1a1a1a;
	font-size: 1rem;
}

.license-section p {
	margin: 0 0 12px;
}

.license-section p:last-child {
	margin-bottom: 0;
}