:root {
  --bg: #f4f7f5;
  --card: #fff;
  --ink: #12241c;
  --muted: #5a6b62;
  --brand: #0b3d2e;
  --brand2: #147a57;
  --danger: #a12020;
  --ok: #0d6b3c;
  --line: #d7e2db;
  --radius: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  min-height: 100dvh; display: flex; flex-direction: column;
}
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--brand); color: #fff;
}
.brand { display: flex; gap: 10px; align-items: center; }
.brand img { border-radius: 8px; background: #fff; }
.brand span { display: block; font-size: 12px; opacity: .85; }
main { flex: 1; padding: 16px; max-width: 520px; width: 100%; margin: 0 auto; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
  box-shadow: 0 8px 24px rgba(11,61,46,.06);
}
h1 { margin: 0 0 8px; font-size: 1.35rem; }
.muted { color: var(--muted); font-size: .92rem; }
label { display: block; margin: 12px 0 6px; font-weight: 600; font-size: .92rem; }
input[type=email], input[type=password], input[type=text] {
  width: 100%; margin-top: 6px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); font-size: 16px;
  background: #fff; color: #12241c; -webkit-text-fill-color: #12241c;
  caret-color: #12241c;
}
input[type=email]::placeholder,
input[type=password]::placeholder,
input[type=text]::placeholder {
  color: #5a6b62; -webkit-text-fill-color: #5a6b62; opacity: 1;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: #12241c !important;
  caret-color: #12241c;
  box-shadow: 0 0 0 1000px #fff inset;
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  transition: background-color 99999s ease-out 0s;
}
button, .btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 12px; padding: 12px 16px; font-size: 16px;
  font-weight: 650; cursor: pointer; text-decoration: none;
}
button.primary, .btn.primary, button[type=submit] {
  background: var(--brand2); color: #fff; width: 100%; margin-top: 14px;
}
button.link, .link {
  background: transparent; color: inherit; text-decoration: underline;
  padding: 8px; width: auto; margin: 0;
}
.top .link { color: #fff; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.hidden { display: none !important; }
.msg { min-height: 1.2em; margin-top: 10px; font-size: .92rem; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }
#preview {
  width: 100%; max-height: 280px; object-fit: contain;
  border-radius: 12px; background: #0b3d2e0d; margin: 12px 0;
}
.row { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.row .primary { flex: 1; margin-top: 0; }
.secondary-actions { margin-top: 10px; }
button.secondary, .btn.secondary {
  flex: 1; background: transparent; color: var(--brand2);
  border: 1.5px solid var(--brand2); margin-top: 0;
}
button.ghost, .btn.ghost {
  flex: 1; background: transparent; color: var(--muted);
  border: 1.5px solid var(--line); margin-top: 0;
}
@media (prefers-color-scheme: dark) {
  button.secondary, .btn.secondary { color: #6ddea6; border-color: #6ddea6; }
}
.tips { color: var(--muted); font-size: .88rem; padding-left: 18px; }
.homescreen { margin-top: 18px; color: var(--muted); font-size: .9rem; }
.homescreen ol { padding-left: 18px; }
footer { text-align: center; padding: 16px; color: var(--muted); }
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1410; --card: #15221b; --ink: #e8f2ec; --muted: #9bb0a4;
    --line: #24352c; --danger: #ff8e8e; --ok: #6ddea6;
  }
  input[type=email], input[type=password], input[type=text] {
    background: #0f1a15; color: #e8f2ec; -webkit-text-fill-color: #e8f2ec;
    caret-color: #e8f2ec; border-color: var(--line);
  }
  input[type=email]::placeholder,
  input[type=password]::placeholder,
  input[type=text]::placeholder {
    color: #9bb0a4; -webkit-text-fill-color: #9bb0a4; opacity: 1;
  }
  input:-webkit-autofill,
  input:-webkit-autofill:hover,
  input:-webkit-autofill:focus {
    -webkit-text-fill-color: #e8f2ec !important;
    caret-color: #e8f2ec;
    box-shadow: 0 0 0 1000px #0f1a15 inset;
    -webkit-box-shadow: 0 0 0 1000px #0f1a15 inset;
  }
}
