/* IndTax – base styles. Kept deliberately plain; the page design round comes later. */
:root {
  --ink: #1b2430;
  --muted: #5b6573;
  --line: #d9dee5;
  --bg: #f6f7f9;
  --card: #ffffff;
  --brand: #1f4e79;
  --brand-dark: #163a5a;
  --ok-bg: #e7f4ea; --ok-ink: #1d5c2e;
  --warn-bg: #fff4e0; --warn-ink: #7a4b00;
  --err-bg: #fdecec; --err-ink: #8a1f1f;
  --radius: 8px;
  font-size: 16px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; line-height: 1.5;
}
a { color: var(--brand); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 8px; top: 8px; background: #fff; padding: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.site-header { background: var(--brand); color: #fff; }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 60px; flex-wrap: wrap; }
.brand { color: #fff; font-weight: 700; font-size: 1.25rem; text-decoration: none; }
.main-nav { display: flex; gap: 18px; align-items: center; flex: 1; }
.main-nav a { color: #fff; text-decoration: none; }
.main-nav a:hover { text-decoration: underline; }
.header-account { display: flex; gap: 12px; align-items: center; font-size: .9rem; }
.header-account form { margin: 0; }
.switcher select { padding: 4px 6px; border-radius: 4px; border: 0; }
.link-button { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

main.wrap { padding-top: 28px; padding-bottom: 48px; }
h1 { font-size: 1.75rem; margin: 0 0 16px; }
h2 { font-size: 1.25rem; margin: 28px 0 12px; }
.lead { font-size: 1.1rem; color: var(--muted); }
.muted { color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }

.messages { margin-bottom: 16px; }
.message { padding: 10px 14px; border-radius: var(--radius); margin: 0 0 8px; background: #eef3f8; }
.message-success { background: var(--ok-bg); color: var(--ok-ink); }
.message-warning { background: var(--warn-bg); color: var(--warn-ink); }
.message-error { background: var(--err-bg); color: var(--err-ink); }

/* Forms (also used by django-allauth's default form rendering) */
form p, .field { margin: 0 0 16px; }
label { display: block; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=tel],
input[type=number], select, textarea {
  width: 100%; max-width: 100%; padding: 9px 10px; border: 1px solid #b8c0cc; border-radius: 6px;
  font: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus, button:focus, a:focus { outline: 3px solid #ffbf47; outline-offset: 1px; }
.helptext, .help { display: block; color: var(--muted); font-size: .9rem; font-weight: normal; margin-top: 4px; }
.errorlist { color: var(--err-ink); list-style: none; padding: 0; margin: 4px 0; }
ul.radio, form ul:not(.errorlist) { list-style: none; padding: 0; margin: 0; }
input[type=radio], input[type=checkbox] { margin-right: 8px; }
form ul:not(.errorlist) label { font-weight: normal; display: flex; align-items: center; margin: 6px 0; }

button, .button {
  display: inline-block; background: var(--brand); color: #fff; border: 0; border-radius: 6px;
  padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
button:hover, .button:hover { background: var(--brand-dark); }
.button-secondary { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.button-secondary:hover { background: #eef3f8; }
.button-danger { background: #a12a2a; }
.button-small { padding: 6px 12px; font-size: .9rem; }
.inline-form { display: inline; margin: 0; }

table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
dl.details { display: grid; grid-template-columns: 220px 1fr; gap: 8px 16px; margin: 0; }
dl.details dt { color: var(--muted); }
dl.details dd { margin: 0; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .8rem; background: #eef3f8; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.reference { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.2rem; letter-spacing: .1em; }
.site-footer { color: var(--muted); font-size: .85rem; padding: 24px 0; border-top: 1px solid var(--line); }

@media (max-width: 700px) {
  dl.details { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .header-inner { padding: 8px 0; }
}

/* Conditional fields (static/js/forms.js) */
[hidden] { display: none !important; }

/* Live password checklist */
.pw-rules { list-style: none; padding: 0; margin: 8px 0 0; font-size: .9rem; }
.pw-rule { display: flex; align-items: baseline; gap: 8px; margin: 3px 0; color: var(--ink); }
.pw-icon { display: inline-block; width: 1.1em; text-align: center; font-weight: 700; }
.pw-rule.is-pending .pw-icon { color: #8a94a3; }
.pw-rule.is-ok .pw-icon { color: #1d7a3a; }
.pw-rule.is-bad .pw-icon { color: #b42318; }
.pw-rule.is-pending .pw-label { color: var(--muted); }

/* Sectioned forms (e.g. client details) */
.form-section h2, .section-title { margin: 0 0 16px; font-size: 1.15rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid .field-wide { grid-column: 1 / -1; }
.phone-row { display: flex; gap: 8px; }
.phone-row select { flex: 0 0 210px; width: 210px; }
.phone-row input { flex: 1; min-width: 0; }
.lookup-row { display: flex; gap: 8px; }
.lookup-row input { flex: 1; min-width: 0; max-width: 220px; }
.lookup-results { margin-top: 8px; }
.address-lookup { padding: 14px 16px; background: #f1f5f9; border-radius: var(--radius); margin-bottom: 16px; }
@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
  .phone-row { flex-direction: column; }
  .phone-row select { width: 100%; flex-basis: auto; }
}
