:root {
  --fvbackground: #fafaff;
  --fvblue: #094074;
  --fvbluelight: #1265a1;
  --fvbluelight2: #018fe2;
  --fvlink:#e7e7e7;
  --fvgrayl1:#f9f9f9;
  --fvgrayl2:#e4e4e4;
  --fvgreenrd:#a2bf99;
  --fvsoftpink:#e4d4c8;
  --fvdarkgreen:#12663f;
  --fvbutton1:#7c9efc;
  --fvbutton2:#507dfa;
}

/* ---------- LOGIN FLOAT ----------- */
@media screen and (min-width: 64em) {
  .pure-u-lg-5-24 {
    display: inline-block !important;
  }
}

@media screen and (min-width: 64em) {
  .pure-u-lg-19-24 {
    width: 99% !important;
  }
}

/*@media screen and (max-width: 64em) {*/
/*  .pure-u-lg-5-24 {*/
/*    display: inline-block !important;*/
/*  }*/
/*}*/

/* Headers */
#verbs-count-wrapper {
  padding: 0 0 15px;
  color: green;
  font-size: 18px;
 /* height : 18px*/
}

/* ---------- FORM ----------- */
.exercisebuilder-form {
  /* border: 2px dotted rgb(96 139 168); */
  display: flex;
  flex-wrap: wrap;
  width: 99%;
  line-height: 14px;
}

/* overrule bootstrap */
#exercisebuilder-form > .form-item {
  margin: 0 4px 25px 4px;
}

.eb-unregistered-warning-container {
  width: 100%;
  flex: 0 0 100%;
  line-height: 1.5;
}

.eb-unregistered-warning-container .messages--warning {
  width: 100%;
  margin: 0 0 10px 0;
  background-position: 8px 50%;
}

#exercisebuilder-form > div.col-items.js-form-item > label {
  margin: 0 5px 0 5px;
}

/* all input types */
fieldset,
#edit-type--wrapper, #edit-level--wrapper,
#edit-group--wrapper, #edit-persons--wrapper, #edit-elles--wrapper,
#edit-reflexive--wrapper, #edit-auxiliary--wrapper {
  padding: 0;
  width: 18.9%;
  min-width: 200px;
  border-width: medium;
  /* background-color : lightgrey; */
}

#edit-level > div.js-form-item.form-item.js-form-type-checkbox.form-type-checkbox > label,
#edit-group > div.js-form-item.form-item.js-form-type-checkbox.form-type-checkbox > label,
#edit-persons > div.js-form-item.form-item.js-form-type-checkbox.form-type-checkbox > label{
  margin: 0.20rem 0;
}

#exercisebuilder-form > div.custverbs-inline > div > label {
  display: inline-block;
  width: 100%;
}

#edit-topcustverbs {
  width: 98%;
}

#edit-custverbs-counter {
  padding: 5px 0 0 0;
  color: darkgray;
}

/* Inline layout for custom verbs input and check button */
.custverbs-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  width: 100%;
}

#edit-check-verbs {
  margin: 6px 0 0 5px;
  padding: 4px 8px;
  font-size: 0.9rem;
}

/* ---------- TENSES ----------- */
#edit-tenses--wrapper,
#edit-rules--wrapper {
  width: 99%;
  padding: 0;
  margin-bottom: 0 !important;
}

#edit-tenses,
#edit-rules {
  display: grid;
  padding: 3px 0 0 3px;
  grid-template-columns: 0.7fr 0.8fr;
  gap: 0;
  align-content: center;
  align-items: center;
}

#edit-tenses .form-checkbox {
  margin: 0.20rem 0;
}

#edit-rules .form-checkbox {
  margin: 0.4rem;
}

.form-radio {
  accent-color: #407697;
}

#edit-rules > .form-type-checkbox {
  margin-top: 0.0em;
  margin-bottom: 0.0em;
  accent-color: #407697;
}

/* ---------- CHECKBOX EFFECT ----------- */
@supports (-webkit-appearance: none) or (-moz-appearance: none) {
  .checkbox-wrapper input[type=checkbox] {
    --active: #407697;
    --active-inner: #fff;
    --focus: 2px rgba(39, 94, 254, .3);
    --border: #BBC1E1;
    --border-hover: #407697;
    --background: #fff;
    --disabled: #c8c8c8;
    --disabled-inner: #E1E6F9;
    -webkit-appearance: none;
    -moz-appearance: none;
    height: 21px;
    outline: none;
    display: inline-block;
    vertical-align: top;
    position: relative;
    margin: 0;
    cursor: pointer;
    border: 1px solid var(--bc, var(--border));
    background: var(--b, var(--background));
    transition: background 0.3s, border-color 0.3s, box-shadow 0.2s;
  }
  .checkbox-wrapper input[type=checkbox]:after {
    content: "";
    display: block;
    left: 0;
    top: 0;
    position: absolute;
    transition: transform var(--d-t, 0.3s) var(--d-t-e, ease), opacity var(--d-o, 0.2s);
  }
  .checkbox-wrapper input[type=checkbox]:checked {
    --b: var(--active);
    --bc: var(--active);
    --d-o: .3s;
    --d-t: .6s;
    --d-t-e: cubic-bezier(.2, .85, .32, 1.2);
  }
  .checkbox-wrapper input[type=checkbox]:disabled {
    background-color: #dcdcdc !important;
    cursor: not-allowed;
    opacity: 0.5;
  }
  .checkbox-wrapper input[type=checkbox]:disabled:checked {
    --b: var(--disabled-inner);
    --bc: var(--border);
  }
  .checkbox-wrapper input[type=checkbox]:disabled + label {
    cursor: not-allowed;
  }
  .checkbox-wrapper input[type=checkbox]:hover:not(:checked):not(:disabled) {
    --bc: var(--border-hover);
  }
  .checkbox-wrapper input[type=checkbox]:focus {
    box-shadow: 0 0 0 var(--focus);
  }
  .checkbox-wrapper input[type=checkbox]:not(.switch) {
    width: 18px;    /* ! */
    height: 18px;   /* ! */
  }
  .checkbox-wrapper input[type=checkbox]:not(.switch):after {
    opacity: var(--o, 0);
  }
  .checkbox-wrapper input[type=checkbox]:not(.switch):checked {
    --o: 1;
  }
  .checkbox-wrapper input[type=checkbox] + label {
    display: inline-block;
    vertical-align: middle;
    cursor: pointer;
    margin-left: 0;   /* ! */
  }
  .checkbox-wrapper input[type=checkbox]:not(.switch) {
    border-radius: 7px;
  }
  .checkbox-wrapper input[type=checkbox]:not(.switch):after {
    width: 5px;
    height: 8px;
    border: 2px solid var(--active-inner);
    border-top: 0;
    border-left: 0;
    left: 6px;
    top: 4px;
    transform: rotate(var(--r, 20deg));
  }
  .checkbox-wrapper input[type=checkbox]:not(.switch):checked {
    --r: 43deg;
  }
}

.checkbox-wrapper * {
  box-sizing: inherit;
}

.checkbox-wrapper *:before,
.checkbox-wrapper *:after {
  box-sizing: inherit;
}

.cb--tgl {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cb--big {
  max-height: 300px;
  overflow-y: auto;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* -------------- Responsive adjustment for mobile -------------- */
@media (max-width: 576px) {
  #edit-tenses .form-checkboxes,
  #edit-rules .form-checkboxes {
    grid-template-columns: 1fr;
  }
}

#edit-tenses legend,
#edit-rules legend {
  font-weight: bold;
  padding: 0 0.5rem;
}

#edit-tense-check-button-wrapper,
#edit-rule-check-button-wrapper {
  width: 99.9%;
  margin-bottom: 30px;
}

.justify-content-between {
  display: flex !important;
  justify-content: space-between !important;
}

/* ---------- RULES ----------- */
#edit-rules > .form-type-checkbox {
  width: 48%;
  vertical-align: middle;
  text-wrap: nowrap;
  font-size: 15px; /* smaller then Tenses */
}

/* ---------- ? ----------- */
*, ::after, ::before {
  box-sizing: border-box;
}

/* ---------- BLOCK TITLES ----------- */
/* block SELECTS */
#edit-type--wrapper > legend, #edit-level--wrapper > legend,
#edit-group--wrapper > legend, #edit-persons--wrapper > legend,
#edit-elles--wrapper > legend, #edit-reflexive--wrapper > legend,
#edit-auxiliary--wrapper > legend, #edit-tenses--wrapper > legend,
#edit-rules--wrapper > legend,
#edit-options--wrapper > legend,
.form-item-whatverbs > label, .form-item-topselect > label,
.form-item-howmany > label, .form-item-topcustverb > label,
.form-item-topcustverbs > label, .form-item-custverbs > label,
.form-item-cus-title > label, .form-item-cus-slot > label {
  font-size: 16px;
  font-weight: 600;
  color: var(--fvblue);
  border-bottom: 2px solid var(--fvbluelight);
  padding: 2px 0 2px;
  margin: 0 0 2px 2px;
}


/* input field */
#edit-whatverbs, #edit-topselect, #edit-howmany,
#edit-cus-title, #edit-cus-slot /* selects */
  /*#edit-group, #edit-person, / * checks */
  /*#edit-elles, #edit-reflexive, #edit-auxiliary / * radio */ {
  width: 98%;
  min-width: 100px;
  margin : 10px 0 0 5px;
  padding: 3px;
  height: 2.5em;
}

.form-item-whatverbs, .form-item-topselect, .form-item-howmany,
.form-item-cus-title {
  margin : 0 0 1.5em 0;
  width: 18%;
  min-width: 180px;
}

#edit-options--wrapper  {
  width: 40%!important;
  min-width: 375px;
}

/* Better column layout */
.col-items { /* all */
  margin: 0 5px 0 5px;
  border-width: medium;
  /* background-color : lightgrey; */
}

#exercisebuilder-form > .form-item-cus-slot,
#exercisebuilder-form > .form-item-cus-title {
  width: 28.3%!important;
  min-width: 300px;
}

#verbs-count-wrapper,
#counter-wrapper,
#remark-message {
  display: inline-block;
  width: 99.8%;
  margin : 0;
  line-height: 1.5em;
  /* border: 2px dotted rgb(96 139 168); */
}

/* ---------- INPUT TEXT AREA ----------- */
.form-required {
  display: inline-block;
  width: 99%;
}

.form-item-custverbs,
.form-item-topcustverbs {
  display: inline-block;
  width: 85%;
}

.form-item-cus-title > label,
.form-item-topcustverbs > label {
  display: inline-block;
  width: 100%;
}

#edit-topcustverbs {
  color: #606363;
  height: 70px;
}

#edit-custverbs--description {
  margin: 5px 0 0 0;
  line-height: 16px;
}

.form-textarea-wrapper,
#edit-custverbs {
  margin: 12px 0 0 0;
  opacity: 1;
  width: 100%;
}

#edit-check-verbs {
  margin: 60px 0 0 20px;
  height: 100px;
  width: 12.5%;
}

/* ---------- BUTTONS ----------- */
[type=button]:not(:disabled), [type=reset]:not(:disabled), [type=submit]:not(:disabled), button:not(:disabled) {
  cursor: pointer;
}

.button_gray {
  cursor: pointer;
  width: 180px;
  font: 16px / 2.3em "Trebuchet MS", Helvetica, sans-serif;
  text-align: center;
  text-decoration: none;
  display: block;
  padding: 0 5px;
  margin: 3px 3px 20px 3px;
  -moz-border-radius: 8px;
  -webkit-border-radius: 8px;
  -o-border-radius: 8px;
  -ms-border-radius: 8px;
  border-radius: 8px;
}

.button_gray:hover {
  box-shadow: 0 0 10px 0 #fff inset, 0 0 10px 4px #aaa;
}

.button_gray:focus {
  color: #fff;
  outline: 0;
}

/* ---------- CONJUGATION TABLE  ----------- */
.conjugation-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.conjugation-table th,
.conjugation-table td {
  color : #000;
  padding: 0.5rem;
  border: 1px solid #ddd;
}

.conjugation-table th {
  background-color: #f5f5f5;
  text-align: left;
}

.conjugation-table input {
  width: 100%;
  padding: 0.25rem;
  border: 1px solid #ccc;
}

.conjugation-table input.correct {
  background-color: #dff0d8;
  border-color: #3c763d;
}

.conjugation-table input.incorrect {
  background-color: #f2dede;
  border-color: #a94442;
}

.messages--status {
  height: 50px;
}

#edit-howmany--wrapper {
  width: 5% !important;
  min-width: 75px;
}

#edit-level--wrapper {
  width: 17.5% !important;
  min-width: 120px;
}

#edit-type--wrapper {
  width: 23% !important;
  min-width: 250px;
}

.rules-section-details {
  width: 98%;
  min-width: 500px;
  margin-left: 3px;
  margin-bottom: 2.5rem;
  border: 0 ;
}

.rules-section-details > summary {
  color: var(--fvblue);
  font-size: 16px;
  border-bottom: 2px solid var(--fvbluelight);
  font-weight: 600;
  padding: 2px 0 2px;
}

#edit-rule-check-button-wrapper {
  margin-bottom: 5px;
}

#edit-rules-section > div {
  padding: 2px 0 5px 2px;
}

#exercisebuilder-form > details.rules-section-details,
#exercisebuilder-form > .rules-section-details,
#edit-rules-section--wrapper,
#edit-rules-section {
  width: 100% !important;
  max-width: 100%;
  flex: 0 0 100%;
}

.rules-section-details > summary {
  display: block;
  width: 100%;
}


/* ------ Rules section collapsed hint (click to expand) ------ */
details.rules-section-details:not([open]) > summary::after {
  content: attr(data-collapsed-hint);
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 400;
  color: #666;
}

details.rules-section-details[open] > summary::after {
  content: "";
  display: none;
}



/* ---------- MOBILE (approx. 430x932) ---------- */
@media (max-width: 430px) {
  /* ---------- FORM ----------- */
  .exercisebuilder-form {
    /* border: 2px dotted rgb(96 139 168); */
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    width: 99%;
    line-height: 10px;
    font-size: 0.9em;
    max-width: 429px;
  }

  fieldset,
  #edit-type--wrapper, #edit-level--wrapper,
  #edit-group--wrapper, #edit-persons--wrapper, #edit-elles--wrapper,
  #edit-reflexive--wrapper, #edit-auxiliary--wrapper {
    padding: 0;
    width: 20%;
    min-width: 192px;
    /* background-color : lightgrey;*/
  }

  /* Place Tenses and Rules into a single column */
  #edit-tenses,
  #edit-rules {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 6px 6px 0 6px;
  }

  /* Each checkbox row spans full width and can wrap text */
  #edit-tenses > .form-type-checkbox,
  #edit-rules > .form-type-checkbox {
    width: 100% !important;
    text-wrap: wrap;
    white-space: normal;
    margin-top: 0;
    margin-bottom: 0;
  }

  /* Keep checkbox label text from forcing horizontal scroll */
  #edit-tenses label,
  #edit-rules label {
    white-space: normal;
    font-size: 0.8em;
  }

  /* Slightly tighter general spacing */
  #edit-tenses--wrapper,
  #edit-rules--wrapper {
    margin-bottom: 8px !important;
  }

  .rules-section-details {
    width: 98%;
    min-width: 400px;
    margin-left: 0;
    margin-bottom: 1rem;
    border: 0 ;
  }
}
