/* Style ordered lists to have numbers left of the text */
ol {
  list-style-position: outside;
  margin-left: 0;
  padding-left: 2.2em;
}

ol li {
  margin-bottom: 0;
  text-align: left;
  padding-left: 0;
  text-indent: 0;
  position: relative;
}

ol li {
  /* Perfect hanging indent: aligns wrapped lines with first line text, not number */
  padding-left: 0;
  text-indent: 0;
}

ol {
  /* Remove extra spacing between ol and previous element */
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}
:root {
  --max-w: 720px;
  --gap: 1rem;
  --radius: 8px;
  --brand: #009900; /* primary brand/background color */
  --brand-dark: #007700;
  --brand-darker: #005500;
  --brand-contrast: #ffffff;
  --brand-muted: rgba(0, 153, 0, 0.06);
  --accent: var(--brand);
  --danger: #c62828;
  --danger-dark: #b71c1c;
  --danger-muted: rgba(198, 40, 40, 0.12);
  --danger-contrast: #ffffff;
}
html {
  /* Keeps the root element full height for background color */
  height: 100%;
}

body {
  /* CRITICAL: Allow body to grow with content */
  height: auto;
  /* Ensure it is at least the size of the screen */
  min-height: 100%;
  /* Include padding in the height calculation to prevent unnecessary scrollbars */
  box-sizing: border-box;

  /* Your existing body styles */
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial;
  margin: 0;
  padding: 2rem;
  background: #fafafa;
  color: #111;
}
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  background: #fff;
  padding: clamp(1rem, 3vw, 2rem);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(16, 24, 40, 0.06);
}
.hidden {
  display: none;
}
.error {
  color: #b00020;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  white-space: pre-line;
}
#login-form {
  margin-top: 1.75rem;
}
#login-form {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.login-hidden {
  display: none !important;
}
.success {
  color: var(--brand-dark);
}
label {
  display: block;
  margin: 0 0 0.15rem;
  font-weight: 600;
}
/* Let the gap control vertical spacing */
form label {
  margin-top: 0;
}
input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  box-sizing: border-box;
  border: 1px solid #d0d7de;
  border-radius: var(--radius);
  margin: 0 0 1.1rem;
}
button {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: var(--brand-contrast);
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.12s ease,
    transform 0.06s ease;
}
button {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: var(--brand-contrast);
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.12s ease,
    transform 0.06s ease;
}
button:hover {
  background: var(--brand-dark);
}
button:active {
  background: var(--brand-darker);
  transform: translateY(1px);
}
button:focus {
  outline: 3px solid rgba(0, 153, 0, 0.18);
  outline-offset: 2px;
}
.spacer {
  min-height: 0;
  margin: 0;
  display: none;
}
.repeat-btn {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);
  font-weight: 600;
}
.repeat-btn:hover {
  background: var(--brand-muted);
  color: var(--brand-dark);
}
.repeat-btn:focus {
  outline: 3px solid var(--brand-muted);
  outline-offset: 2px;
}
.repeat-btn:active {
  background: var(--brand-muted);
  color: var(--brand-dark);
  border-color: var(--brand-dark);
}

/* modal confirm for logout */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 2000;
  backdrop-filter: blur(2px);
}

.modal-card {
  width: min(420px, 100%);
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(16, 24, 40, 0.18);
  padding: 1.25rem 1.25rem 1rem;
  animation: modal-pop 160ms ease-out;
}

.modal-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.modal-card p {
  margin: 0 0 1rem;
  color: #333;
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.btn-ghost {
  background: transparent;
  color: #111;
  border: 1px solid #e5e7eb;
}

.btn-ghost:hover {
  background: #f3f4f6;
  color: #111;
  border-color: #d1d5db;
}

.btn-danger {
  background: var(--danger);
  color: var(--danger-contrast);
}

.btn-danger:hover {
  background: var(--danger-dark);
}

@keyframes modal-pop {
  from {
    transform: translateY(6px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0;
    background: #fff;
  }
  .container {
    border-radius: 0;
    padding: 1rem;
    box-shadow: none;
    background: transparent;
  }
  h1 {
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
  }
  input[type="text"] {
    font-size: 1rem;
    padding: 0.75rem;
  }
  button {
    width: 100%;
    font-size: 1rem;
  }
}

@media (min-width: 481px) and (max-width: 1024px) {
  .container {
    padding: 1.25rem;
  }
  h1 {
    font-size: 1.25rem;
  }
  input[type="text"] {
    font-size: 1rem;
  }
}

@media (min-width: 1025px) {
  .container {
    padding: 2rem;
  }
  h1 {
    font-size: 1.5rem;
  }
  input[type="text"] {
    font-size: 1.05rem;
  }
  button {
    width: auto;
  }
}

/* accordion - simplified, lighter design */
.accordion {
  margin-top: 1rem;
}
.accordion input[type="radio"] {
  position: absolute;
  opacity: 0;
  height: 0;
  width: 0;
}
.accordion .acc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: transparent;
  border: 1px solid #eef3f6;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  color: #111;
  transition:
    background 0.12s ease,
    border-color 0.12s ease;
  margin-bottom: 0.75rem;
  position: relative;
}
.accordion .acc-header:hover {
  background: var(--brand-muted);
  border-color: var(--brand-muted);
}
.accordion .acc-header::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--brand-dark);
  border-bottom: 2px solid var(--brand-dark);
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
  transition:
    transform 0.18s ease,
    border-color 0.12s ease;
  display: inline-block;
}
/* Active state: avoid dark border; use subtle muted border and keep text color neutral */
.accordion input[type="radio"]:checked + .acc-header {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  margin-bottom: 0;
  color: inherit;
  background: rgba(0, 153, 0, 0.03);
  border-color: var(--brand-muted);
  box-shadow: none;
}
.accordion input[type="radio"]:checked + .acc-header::after {
  transform: translateY(-50%) rotate(45deg);
  border-color: var(--brand-dark);
}

.acc-panel {
  border: none;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.28s ease,
    padding 0.18s ease;
  padding: 0 1rem;
}
.accordion input[type="radio"]:checked + .acc-header + .acc-panel {
  max-height: 1000px;
  padding: 0.25rem 1rem 0.75rem;
  margin-top: -1px;
  margin-bottom: 0.75rem;
  border: 1px solid var(--brand-muted);
  border-top: 0;
}
.accordion input[type="radio"]:checked + .acc-header + .acc-panel {
  max-height: 5000px;
  padding: 18px 1rem 9px;
  margin-top: -1px;
  margin-bottom: 0.75rem;
  border: 1px solid var(--brand-muted);
  border-top: 0;
}
.acc-panel p {
  margin: 0 0 0.5rem;
  color: #333;
  line-height: 1.5;
}
.acc-panel ul {
  margin: 0 0 0.5rem 0;
  padding-left: 1.25em; /* space for the bullet/marker */
}
.acc-panel li {
  margin-left: 0;
}

.acc-panel ol {
  margin: 0 0 0.5rem 0;
  padding-left: 2.2em; /* space for the marker */
  list-style-position: outside;
  list-style-type: decimal;
}

/* Keep spacing consistent between ul and ol list items inside panels */
.acc-panel ul li,
.acc-panel ol li {
  margin: 0 0 0.5rem 0;
  padding-left: 0;
}

/* Heading spacing inside panels: add top margin so title sits off the panel border */
.acc-panel h1,
.acc-panel h2,
.acc-panel h3,
.acc-panel h4,
.acc-panel h5,
.acc-panel h6 {
  margin: 8px 0 0.5rem;
  font-weight: 700;
}

.acc-panel :first-child {
  margin-top: 0;
}

/* chevron is absolutely positioned and vertically centered */
