/* The 2009 Flex designer (flex/styles.css): grey page, white rounded box, three columns. */
@font-face { font-family: "Nunito Sans Kaart"; src: url("fonts/NunitoSans-Regular.ttf"); font-weight: 400; }
@font-face { font-family: "Nunito Sans Kaart"; src: url("fonts/NunitoSans-Bold.ttf"); font-weight: 700; }

:root {
  --page: #eaeaea;
  --box: #fff;
  --line: #ccc;
  --label: #666;
  --text: #333;
  --field-line: #999;
  --red-top: #cc2929;
  --red-bottom: #991f1f;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 16px 32px;
  background: var(--page);
  color: var(--text);
  font: 14px Arial, Helvetica, sans-serif;
}

.archive {
  max-width: 940px;
  margin: 12px auto;
  font-size: 12px;
  color: var(--label);
  line-height: 1.5;
}
.archive a { color: inherit; }

.container {
  max-width: 940px;
  margin: 0 auto;
  padding: 10px 20px 20px;
  background: var(--box);
  border: 1px solid var(--line);
  border-radius: 5px;
  display: grid;
  grid-template-columns: 290px 316px 270px;
  grid-template-areas:
    "crumbs crumbs crumbs"
    "form preview chooser";
  column-gap: 11px;
  justify-content: space-between;
}

/* Breadcrumb bar */
.crumbs { grid-area: crumbs; display: flex; align-items: center; gap: 8px; height: 30px; }
.crumb { color: #999; font-size: 12px; }
.crumb.current { color: var(--text); font-weight: bold; }
.info { margin-left: auto; border: 0; background: none; padding: 0; cursor: pointer; }

/* Form */
.form { grid-area: form; padding: 25px 10px 0 0; }
.side-title { margin: 0 0 12px; font-size: 14px; font-weight: bold; color: var(--text); }
.row { display: grid; grid-template-columns: 96px 1fr; align-items: start; gap: 8px; margin-bottom: 8px; }
.row > label { color: var(--label); font-size: 14px; padding-top: 4px; text-align: right; }
.row .pair { display: flex; gap: 6px; }
.row input, .row textarea, .row select {
  font: 14px Arial, Helvetica, sans-serif;
  color: var(--text);
  border: 1px solid var(--field-line);
  border-radius: 5px;
  padding: 3px 6px;
  background: #fff;
  width: 100%;
  max-width: 150px;
}
.row textarea { resize: none; line-height: 1.3; }
.row select { font-weight: bold; font-size: 12px; max-width: 75px; height: 24px; }
.row input:disabled, .row textarea:disabled { background: #f4f4f4; color: #999; }
.row input.short { max-width: 44px; }
.row input.tiny { max-width: 34px; }
.row input.mob { max-width: 110px; }
.required { color: var(--label); font-size: 12px; margin-left: 104px; }

/* Preview */
.preview-column { grid-area: preview; display: flex; flex-direction: column; gap: 12px; }
.flags { display: flex; justify-content: flex-end; gap: 14px; height: 24px; margin-right: 8px; }
.flags button { border: 0; background: none; padding: 0; cursor: pointer; opacity: .45; }
.flags button[aria-pressed="true"] { opacity: 1; }
.preview { border: 1px solid #000; padding: 1px; background: #fff; }
.preview svg { display: block; width: 100%; aspect-ratio: 55 / 85; }
.buttons { display: flex; gap: 8px; }

.button {
  min-width: 100px;
  height: 48px;
  padding: 0 14px;
  font: 12px Arial, Helvetica, sans-serif;
  color: #333;
  border: 1px solid #8c8c8c;
  border-radius: 5px;
  background: linear-gradient(#e6e6e6, #ccc);
  cursor: pointer;
}
.button:hover { background: linear-gradient(#f0f0f0, #d5d5d5); }
.button.print {
  color: #fff;
  border-color: var(--red-bottom);
  background: linear-gradient(var(--red-top), var(--red-bottom));
}
.button.print:hover { background: linear-gradient(#d83232, #a82222); }

/* Accordion */
.accordion { grid-area: chooser; margin-top: 36px; border: 1px solid #808080; height: 486px; display: flex; flex-direction: column; }
.accordion-heading {
  text-align: left;
  font: 18px Arial, Helvetica, sans-serif;
  color: var(--label);
  padding: 4px 10px;
  border: 0;
  border-bottom: 1px solid #b3b3b3;
  background: linear-gradient(#fff, #d7d7d7);
  cursor: pointer;
}
.accordion-panel { flex: 1; overflow-y: auto; padding: 10px; }
.grid { display: grid; grid-template-columns: repeat(2, 106px); gap: 20px; justify-content: center; }
.grid button {
  width: 106px;
  height: 161px;
  padding: 2px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}
.grid button[aria-pressed="true"] { border: 2px solid var(--red-bottom); padding: 1px; }
.grid img, .grid svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.own-photo { display: block; margin: 20px auto 6px; width: max-content; }
.own-photo span {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid #8c8c8c;
  border-radius: 5px;
  background: linear-gradient(#e6e6e6, #ccc);
  font-size: 12px;
  cursor: pointer;
}
.own-photo input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.own-photo:focus-within span { outline: 2px solid #4a90c2; }
.hint { color: #999; font-size: 11px; text-align: center; margin: 4px 0; }

/* Dialogs (Preview.mxml, Info.mxml) */
.dialog {
  width: min(300px, calc(100vw - 32px));
  border: 1px solid #999;
  border-radius: 5px;
  padding: 40px 24px 20px;
  color: var(--text);
}
#info-dialog { width: min(400px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(0, 0, 0, .3); }
.dialog h1 { font-size: 20px; margin: 0 0 10px; }
.dialog p { font-size: 13px; line-height: 1.5; }
.dialog label { display: block; margin: 8px 0; font-size: 13px; }
.dialog .button { display: block; margin: 20px auto 0; height: 32px; }
.dialog .button.close { position: absolute; top: 10px; right: 10px; margin: 0; min-width: 0; height: 24px; padding: 0 8px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  background: #333;
  color: #fff;
  border-radius: 5px;
  font-size: 13px;
}

/* Narrow screens: preview first, then the form, then the chooser. */
@media (max-width: 960px) {
  .container {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "crumbs" "preview" "form" "chooser";
    padding: 10px 16px 16px;
  }
  .preview-column { max-width: 316px; width: 100%; margin: 0 auto; }
  .buttons .button { min-width: 0; flex: 1; }
  .form { padding-top: 16px; }
  .accordion { margin-top: 16px; height: auto; }
  .accordion-panel { max-height: 400px; }
}
