/* WSB Popup – <dialog>-Styling */
/* CSS-Variablen müssen im Theme definiert sein:
   --c-light, --c, --c-border, --c-shadow, --rgb-black */

/* Basis-Dialog */
body:has(>dialog[open]) {
	overflow: hidden;
}
dialog.popup {
	all: revert;
	background-clip: padding-box;
	border: none;
	padding: 0;
	max-width: min(900px,90vw);
	max-height: 90vh;
	overflow: visible;
	border-radius: 5px;
	background: var(--thim-body-primary-color);
}

dialog.popup::backdrop {
	transition: all .9s;
	backdrop-filter: blur(3px);
	background: #00000088;
}

dialog.popup > form {
	all: revert;
	display: flex;
	flex-direction: column;
	min-width: 350px;
	max-width: 100%;
	overflow: hidden;
	border-radius: 5px;
	box-shadow: 0 0 100px #00000030;
}
dialog.popup header {
	font-size: 16px;
	border-bottom: 1px solid var(--thim-body-primary-color,#999);
	padding: 10px 20px;
	background: var(--thim-body-primary-color);
	color: #fff;
}
dialog.popup header>* {
	color: #fff !important;
}

dialog.popup header h3 {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 600;
}
dialog.popup main {
	padding: 20px;
	overflow: hidden auto;
	max-height: 60vh;
	line-height: 1.5;
	background-color: var(--c-light, #fff);
	position: relative;
}
dialog.popup ul.form,dialog.popup ul.form>li{
	display: flex;
	flex-flow: column;
	gap:20px 27px;
	margin: 0;
	padding: 0;
	position: relative;
}
dialog.popup ul.form>li{
	flex-flow: row;
	min-width: 460px;
}

/* Response-<output> zwischen <main> und <footer> */
/* display:none bei Leerem, display:block sobald Inhalt via setResponse() */
dialog.popup form > output {
	padding: 10px 20px;
	font-size: 13px;
	border-top: 1px solid var(--thim-body-primary-color);
    background-color: #E5F7FF;
    color: var(--thim-body-primary-color);
    max-width: 100%;
}
dialog.popup form > output:not(:empty):before {
    content: "\f06a ";
    font-size: 1.2em;
	margin-right: 3px;
    font-family: "eduma-icon";
}
dialog.popup form > output:empty {
	display: none;
}
dialog.popup form > output.success {
	background: #d4edda;
	color: #155724;
	border-color: #c3e6cb;
}
dialog.popup form > output.success::before {
    content: "\f058 ";
}
dialog.popup form > output.error {
	background: #FEE5E5;
	color: #721c24;
	border-color: #f5c6cb;
}
dialog.popup form > output.error::before {
    content: "\f057 ";
}

dialog.popup footer {
	background: var(--thim-body-primary-color);
	justify-content: space-between;
	padding: 14px 20px;
	margin: 0;
	display: flex;
	gap: .5rem;
}

.popup footer > * {
	margin: 0 !important;
}
.popup label {
    max-width: 100%;
    width: 140px;
    text-align: right;
    font-size: 12px;
    font-weight: 400;
	margin-top: 3px;
}
dialog.popup ul.form:before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    bottom: -20px;
    width: 175px;
    background: #99863b22;
}
.popup .form-field-input {
	flex: 1;
}
.popup .form-field-input>* {
	width: 100%;
	padding: 5px 10px;
}
.popup .form-field-input>.description {
	padding: 0;
	font-size: 12px;
	color: #999;
	
}
label:has(+div>[required]):after {
    content: '*';
	color: var(--thim-body-secondary-color);
	position: absolute;
    margin: 0 1px;
}
/* Danger-Button (rot) */
.wsb-popup-danger {
	background: #dc3232 !important;
	border-color: #dc3232 !important;
}
.wsb-popup-danger:hover {
	background: #c02626 !important;
}

/* switch button */
@property --checkbox {
  syntax: '<length>';
  initial-value: 12px;
  inherits: false;
}
@property --checkcolor {
  syntax: '<color>';
  initial-value: #99863b;
  inherits: false;
}
.popup .form-field-input>input[type=checkbox] {
	margin: 0;
    display: block;
    cursor: pointer;
    height: 24px;
    width: 38px;
    background: radial-gradient(circle at var(--checkbox), #fff 10px, var(--checkcolor) 11px);
    border-radius: 20px;
	border:none;
	accent-color: #00000000;
	transition: --checkbox .3s, --checkcolor .3s;
}
.popup .form-field-input>input[type=checkbox]:before {
    display:none !important;
}
.popup .form-field-input>input[type=checkbox]:checked {
	--checkbox: 26px;
	--checkcolor: var(--thim-body-primary-color);
}

/* Outdated Browser Support */
.dialog {
	position: fixed;
	top: 0; right: 0; bottom: 0; left: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 99999;
	background: #000000bb;
}