/*
 * BABYLON: Signalis — calendar & PKZ web tool.
 * Win95-era styling: teal background, maroon title bars, beveled controls.
 */

@font-face {
  font-family: 'SignalisSilver';
  src: url('SignalisSilver.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #008080;
  color: #000;
  font-family: 'SignalisSilver', 'Silver', 'Perfect DOS VGA 437', 'Courier New', 'Lucida Console', monospace;
  font-size: 32px;
  min-height: 100vh;
}

body {
  padding: 16px;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: auto;
  font-smooth: never;
  image-rendering: pixelated;
}

/* ------- Window chrome ------- */

.window {
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  box-shadow:
    inset 1px 1px 0 #dfdfdf,
    inset -1px -1px 0 #808080,
    2px 2px 0 #000;
  max-width: 1500px;
  margin: 0 auto 16px auto;
}

.title-bar {
  background: #800020;
  color: #fff;
  padding: 8px 10px;
  font-weight: bold;
  display: flex;
  align-items: center;
  letter-spacing: 0.5px;
  font-size: 34px;
}

.title-bar .title-text {
  flex: 1 1 auto;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 8px;
}

.title-bar .x-close,
.title-bar .x-close-spacer {
  flex: 0 0 40px;
  width: 40px;
  height: 36px;
  line-height: 30px;
  text-align: center;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 26px;
  cursor: default;
  user-select: none;
}

.title-bar .x-close {
  background: #c0c0c0;
  color: #000;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
}

.title-bar .x-close-spacer {
  visibility: hidden;
}

.window-body {
  padding: 12px;
  background: #c0c0c0;
}

/* ------- Tab strip ------- */

.tab-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 10px 10px 0 10px;
  background: #c0c0c0;
}

.tab {
  background: #c0c0c0;
  color: #000;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  padding: 13px 28px;
  cursor: pointer;
  user-select: none;
  font-family: inherit;
  font-size: 30px;
  position: relative;
  top: 2px;
}

.tab:hover { background: #d4d0c8; }

.tab.active {
  background: #ffffff;
  font-weight: bold;
  top: 0;
  z-index: 2;
}

.tab-content {
  display: none;
  padding: 18px;
  background: #ffffff;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  margin-top: 0;
}

.tab-content.active { display: block; }

/* ------- Form controls ------- */

label {
  display: block;
  margin-bottom: 6px;
  margin-top: 14px;
  font-size: 29px;
}

label.inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 10px;
}

input[type="text"], select, textarea {
  display: block;
  width: 100%;
  background: #ffffff;
  color: #000;
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  padding: 12px 32px;
  font-family: inherit;
  font-size: 30px;
}

input[type="text"]:focus, select:focus, textarea:focus {
  outline: 1px dotted #000;
  outline-offset: -3px;
}

input[type="checkbox"] {
  appearance: none;
  width: 26px;
  height: 26px;
  background: #ffffff;
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  cursor: pointer;
  position: relative;
  margin: 0;
  vertical-align: middle;
}

input[type="checkbox"]:checked::after {
  content: 'x';
  position: absolute;
  top: -10px;
  left: 4px;
  font-size: 30px;
  font-weight: bold;
  color: #000;
}

button {
  background: #c0c0c0;
  color: #000;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  padding: 12px 28px;
  cursor: pointer;
  font-family: inherit;
  font-size: 30px;
  min-width: 170px;
  user-select: none;
}

button:hover { background: #d4d0c8; }

button:active,
button.pressed {
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  padding: 13px 27px 11px 29px;
}

.button-row {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ------- Output panel ------- */

.output-panel {
  margin-top: 22px;
  background: #ffffff;
  color: #000;
  padding: 18px;
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  min-height: 150px;
  font-family: 'SignalisSilver', 'Silver', 'Perfect DOS VGA 437', 'Courier New', 'Lucida Console', monospace;
  white-space: pre-wrap;
  font-size: 30px;
  line-height: 1.5;
  overflow-x: auto;
}

.output-panel .hint {
  color: #800000;
  font-style: italic;
}

.output-panel .error {
  color: #800000;
  font-weight: bold;
}

.output-panel .header {
  font-weight: bold;
}

.output-panel .pass { color: #006020; font-weight: bold; }
.output-panel .fail { color: #a00000; font-weight: bold; }

/* ------- PKZ alternatives display ------- */

.alts-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin-top: 6px;
  align-items: baseline;
}

.alts-grid .alt-prefix {
  font-weight: bold;
  font-family: 'SignalisSilver', 'Silver', 'Perfect DOS VGA 437', 'Courier New', monospace;
}

.alts-grid .alt-label {
  font-size: 28px;
  color: #404040;
}

.alts-grid input[type="radio"] {
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  position: relative;
  cursor: pointer;
}

.alts-grid input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #000;
}

/* ------- Sub-headings inside content ------- */

h2 {
  font-size: 36px;
  margin: 0 0 18px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #808080;
  font-weight: bold;
  letter-spacing: 0.5px;
}

p.help {
  font-size: 27px;
  color: #404040;
  margin: 0 0 12px 0;
  line-height: 1.4;
}

p.help kbd, code {
  background: #e8e8e8;
  padding: 2px 6px;
  font-family: 'SignalisSilver', 'Silver', 'Perfect DOS VGA 437', 'Courier New', monospace;
  border: 1px solid #b0b0b0;
}

/* ------- Info tab body text ------- */

.tab-content p {
  margin: 0 0 14px 0;
  line-height: 1.4;
}

.tab-content h2:not(:first-child) {
  margin-top: 28px;
}

.info-list {
  margin: 0 0 18px 0;
  padding-left: 36px;
  line-height: 1.45;
}

.info-list li {
  margin-bottom: 6px;
}

/* ------- Compact rows of two inputs ------- */

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

/* ------- Status / persistent toggles ------- */

.tab-toolbar {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 29px;
}

.tab-toolbar label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ------- Footer ------- */

.window-footer {
  padding: 16px 22px;
  background: #c0c0c0;
  border-top: 1px solid #808080;
  font-size: 26px;
  color: #404040;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.window-footer .credit {
  text-align: left;
  line-height: 1.6;
}

.window-footer .credit strong {
  color: #800000;
}
