/* Same green palette as the application; no private app shell is loaded here. */
:root {
  --ink: #253b34;
  --muted: #59675c;
  --green: #245b4e;
  --green-deep: #1d493f;
  --cream: #f5f5ef;
  --surface: #fffefa;
  --line: #e4e7de;
  --danger: #a94436;
}

* { box-sizing: border-box; }

html {
  color-scheme: light;
  scroll-padding-block: 24px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--cream);
  color: var(--ink);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.login-panel {
  width: 100%;
  max-width: 384px;
  margin-block: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 5px 22px rgb(34 61 47 / 3.5%);
}

h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -.7px;
}

.login-caption {
  margin: 7px 0 24px;
  color: var(--muted);
}

.login-form,
.field-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.login-form { gap: 18px; }
.field-group { gap: 7px; }

label {
  width: fit-content;
  font-weight: 600;
}

input,
button {
  font: inherit;
  color: inherit;
}

input:not([type="hidden"]) {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid #cbd4ca;
  border-radius: 10px;
  background: #fff;
  /* 16px avoids the automatic field zoom on iPhone. */
  font-size: 16px;
  line-height: 1.5;
  scroll-margin-block: 24px;
}

input:focus {
  border-color: var(--green);
  outline: 3px solid #b9cec1;
  outline-offset: 2px;
}

input[aria-invalid="true"] { border-color: var(--danger); }

.login-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 3px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 140ms ease;
}

.login-submit:hover,
.login-submit:active { background: var(--green-deep); }

.login-submit:focus-visible {
  outline: 3px solid #8d762e;
  outline-offset: 3px;
}

.form-errors,
.field-errors {
  color: var(--danger);
  overflow-wrap: anywhere;
}

.form-errors {
  border: 1px solid #e9d1c4;
  border-radius: 10px;
  background: #fcf2ee;
  padding: 11px 12px;
}

.errorlist { margin: 0; padding: 0; list-style: none; }
.errorlist li + li { margin-top: 6px; }

@media (max-width: 380px) {
  .login-panel { padding: 23px 20px; border-radius: 18px; }
}

/* Keep the top and form reachable in landscape or with a resized keyboard viewport. */
@media (max-height: 560px) {
  .login-panel { margin-block: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .login-submit { transition: none; }
}

@media (forced-colors: active) {
  .login-submit { border-color: ButtonText; }
}
