/* KiraTavan — form controls, dark mode, focus (loads after Tailwind) */

html.dark {
  color-scheme: dark;
}

/* Chevron only on selects — do not set a global light background (breaks dark mode) */
select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6"><path fill="%235d6e65" d="M0 0l5 6 5-6z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.6rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

select:focus,
input[type="text"]:focus {
  outline: none;
  border-color: #128a4e;
  box-shadow: 0 0 0 2px rgba(18, 138, 78, 0.25);
}

/* Dark mode form fields — !important beats stale/light utility layers on CDN */
html.dark select,
html.dark input[type="text"],
html.dark #kind,
html.dark #rent,
html.dark #month,
html.dark #agreed {
  color: #e8f6ee !important;
  background-color: #1e2d26 !important;
  border-color: #4a6b5c !important;
  -webkit-text-fill-color: #e8f6ee;
}

html.dark select {
  background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6"><path fill="%23b7c9be" d="M0 0l5 6 5-6z"/></svg>');
}

html.dark select:focus,
html.dark input[type="text"]:focus {
  box-shadow: 0 0 0 2px rgba(142, 224, 178, 0.45);
  border-color: #8ee0b2 !important;
}

html.dark select option {
  background-color: #18241e;
  color: #e8f6ee;
}

html.dark input::placeholder {
  color: #9bb5a8 !important;
  opacity: 1;
}

:focus-visible {
  outline: 2px solid #128a4e;
  outline-offset: 2px;
}

html.dark :focus-visible {
  outline-color: #8ee0b2;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 100;
  padding: 0.65rem 1rem;
  background: #128a4e;
  color: #fff;
  font-weight: 700;
  border-radius: 0.5rem;
  text-decoration: none;
}

.skip-link:focus {
  left: 0.5rem;
}

html.dark .skip-link {
  color: #082214;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}