/* The Authority's public pages. Phone first: everything is one column at 375 px and widens from 640 px.
   Palette (from the logo): deep teal #003A45, teal #0F6F7C, gold #C9A227, pale gold #E8CF7A, text #10222B,
   muted #566166, danger #B42318. Input text is 16 px so phones do not zoom in; tap targets are 44 px or more. */

:root {
  --teal-deep: #003A45; --teal: #0F6F7C; --gold: #C9A227; --gold-pale: #E8CF7A;
  --text: #10222B; --muted: #566166; --danger: #B42318; --line: #D5DDE0; --page: #F4F7F8; --card: #fff;
}

body { background: var(--page); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 16px; line-height: 1.5; }
[hidden] { display: none !important; }
.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; }
.rg-skip { position: absolute; left: -9999px; top: 0; background: var(--gold); color: var(--teal-deep); padding: 10px 14px; z-index: 100; }
.rg-skip:focus { left: 8px; top: 8px; }
a { color: var(--teal); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, .btn:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; }

/* the ribbon (banner_html in hooks.py) */
.rg-ribbon { background: var(--gold); color: var(--teal-deep); text-align: center; font-size: 14px; font-weight: 600; padding: 6px 16px; }

/* header */
.rg-header { background: #fff; border-bottom: 4px solid var(--teal); box-shadow: 0 2px 0 var(--gold-pale); }
.rg-wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.rg-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; padding-top: 8px; padding-bottom: 8px; }
.rg-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--teal-deep); min-height: 56px; }
.rg-brand img { height: 46px; width: auto; flex: none; }
.rg-brand b { display: block; font-size: 19px; line-height: 1.2; }
.rg-brand small { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; }
.rg-nav { display: flex; flex-wrap: wrap; gap: 0 4px; }
.rg-nav a, .rg-linkbtn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; font-size: 15px; font-weight: 600; color: var(--teal); text-decoration: none; background: none; border: 0; cursor: pointer; font-family: inherit; }
.rg-nav a:hover, .rg-linkbtn:hover { text-decoration: underline; }

/* page */
.rg-main { outline: none; }
.rg-page { padding-top: 20px; padding-bottom: 48px; overflow-wrap: anywhere; }
.card > .btn, .card form > .btn, form.card > .btn { margin-top: 16px; }
.rg-page h1 { font-size: 26px; line-height: 1.2; color: var(--teal-deep); margin: 8px 0 8px; }
.rg-page h2 { font-size: 20px; color: var(--teal-deep); margin: 0 0 8px; outline: none; }
.rg-page h3 { font-size: 17px; color: var(--teal-deep); margin: 20px 0 4px; }
.rg-page h4 { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 16px 0 6px; }
.lede { color: var(--muted); font-size: 17px; margin: 0 0 16px; }
.hint { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.card { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--teal); border-radius: 6px; padding: 16px; margin: 0 0 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.more { margin: 0 0 16px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border: 2px solid var(--teal); border-radius: 6px; background: var(--teal); color: #fff; font-size: 16px; font-weight: 700; font-family: inherit; text-decoration: none; cursor: pointer; text-align: center; }
.btn:hover { background: var(--teal-deep); border-color: var(--teal-deep); color: #fff; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--teal-deep); }
.btn-gold:hover { background: var(--gold-pale); border-color: var(--gold-pale); color: var(--teal-deep); }
.btn-plain { background: #fff; color: var(--teal); }
.btn-plain:hover { background: var(--page); color: var(--teal-deep); }
.btn-small { min-height: 44px; padding: 0 14px; font-size: 15px; }
.btn[disabled] { opacity: .6; cursor: default; }
.step-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.step-nav .btn { flex: 1 1 140px; }

/* forms */
.fld { margin: 14px 0 0; }
.fld label { display: block; font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.req { color: var(--danger); }
.fld input[type=text], .fld input[type=email], .fld input[type=tel], .fld input[type=number], .fld input[type=date], .fld select {
  display: block; width: 100%; min-height: 48px; padding: 8px 12px; border: 1px solid #9AA7AC; border-radius: 6px; background: #fff; color: var(--text); font-size: 16px; font-family: inherit; }
.fld input[type=file] { display: block; width: 100%; min-height: 48px; padding: 10px 0; font-size: 16px; }
.fld input:focus, .fld select:focus { border-color: var(--teal); outline: 3px solid var(--gold-pale); }
.fld [aria-invalid=true] { border-color: var(--danger); }
.err { color: var(--danger); font-size: 15px; font-weight: 600; margin: 6px 0 0; }
.rg-row { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
.check-row { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; }
.check-row input { flex: none; width: 24px; height: 24px; margin-top: 10px; accent-color: var(--teal); }
.check-row label { margin: 0; padding: 10px 0; font-weight: 600; }
label.opt, .fld label.opt { display: flex; font-weight: 400; font-size: 16px; align-items: flex-start; gap: 12px; padding: 12px; margin: 8px 0 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; min-height: 44px; }
.opt input { flex: none; width: 22px; height: 22px; margin-top: 2px; accent-color: var(--teal); }
.opt b { display: block; font-weight: 700; }
.opt small { display: block; color: var(--muted); font-size: 14px; font-weight: 400; margin-top: 2px; }
.opt:has(input:checked) { border-color: var(--teal); background: #E7F2F4; }
.rg-step { margin: 0; }
.rg-step.is-off { display: none; }
.rg-progress { color: var(--muted); font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.amount { font-size: 30px; font-weight: 800; color: var(--teal-deep); margin: 4px 0; }

/* notices */
.notice { background: #E7F2F4; border-left: 4px solid var(--teal); padding: 10px 12px; margin: 14px 0; }
.notice p { margin: 4px 0 0; }
.warning { background: #FFF4F2; border: 2px solid var(--danger); border-radius: 6px; padding: 12px; margin: 16px 0 0; color: #7A1A12; }
.warning p { margin: 4px 0 0; }
.flash { background: #E7F2F4; border-left: 4px solid var(--teal); padding: 10px 12px; margin: 0 0 16px; font-weight: 600; }
.flash-bad { background: #FFF4F2; border-left-color: var(--danger); color: #7A1A12; }
.next { padding-left: 20px; }
.next li { margin: 6px 0; }

/* lists and records */
.list { list-style: none; padding: 0; margin: 8px 0 0; }
.list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list small { color: var(--muted); font-size: 14px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rec { padding: 10px 0; border-top: 1px solid var(--line); }
.rec:first-of-type { border-top: 0; }
.rec-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.rec-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.rec-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: #E8EDEF; color: var(--text); }
.badge-approved, .badge-paid, .badge-active { background: #DDF3E4; color: #0B5D2A; }
.badge-pending-review, .badge-submitted, .badge-due, .badge-pending { background: #FBF0C8; color: #6B5200; }
.badge-revoked, .badge-rejected, .badge-expired { background: #FBE0DC; color: #8A1A10; }

/* landing */
.hero { padding: 8px 0 4px; }
.choices { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0 0 16px; }
.choice-card { display: block; background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--gold); border-radius: 6px; padding: 16px; text-decoration: none; color: var(--text); min-height: 44px; }
.choice-card:hover { border-left-color: var(--teal); box-shadow: 0 2px 8px rgba(0, 58, 69, .12); }
.choice-card b { display: block; font-size: 18px; color: var(--teal-deep); margin-bottom: 4px; }
.choice-card span { color: var(--muted); font-size: 15px; }
.rules { padding-left: 20px; margin: 8px 0 0; }
.rules li { margin: 4px 0; }
.fees { list-style: none; padding: 0; margin: 8px 0 0; }
.fees li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid var(--line); }
.fees li:first-child { border-top: 0; }
.fees b { white-space: nowrap; }
.tag { display: block; color: var(--muted); font-size: 13px; }
.proposed { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 8px; }
.proposed summary { cursor: pointer; font-weight: 700; color: var(--teal-deep); min-height: 44px; display: flex; align-items: center; }

/* verify */
.status { display: inline-block; font-size: 26px; font-weight: 800; margin: 0 0 8px; padding: 2px 14px; border-radius: 6px; background: #E8EDEF; }
.status-valid { background: #DDF3E4; color: #0B5D2A; }
.status-expired, .status-transferred { background: #FBF0C8; color: #6B5200; }
.status-revoked { background: #FBE0DC; color: #8A1A10; }
.facts { display: grid; grid-template-columns: 1fr; gap: 0; margin: 8px 0; }
.facts dt { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; margin-top: 10px; }
.facts dd { margin: 0; font-weight: 600; }

/* certificate: the print format's own HTML, made to fit a phone and printed without the page around it */
.rg-cert { background: #fff; border: 1px solid var(--line); padding: 16px; margin: 0 0 16px; overflow-wrap: anywhere; }
.rg-cert img { max-width: 100%; height: auto; }
@media (max-width: 600px) {
  .rg-cert .uc td, .rg-cert .uc tr, .rg-cert .uc table { display: block; width: 100% !important; }
  .rg-cert .uc td[style*="center"] { margin-top: 16px; }
  .rg-cert .uc .sign { width: 70%; }
}

/* footer */
.rg-footer { background: var(--teal-deep); color: #fff; padding: 24px 0 16px; margin-top: 24px; font-size: 14px; }
.rg-footer a { color: var(--gold-pale); display: inline-block; padding: 12px 0; }
.rg-footer address { font-style: normal; margin: 4px 0 8px; }
.rg-footer p { margin: 0 0 8px; }
.rg-foot-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.rg-foot-demo { border-top: 1px solid rgba(255, 255, 255, .25); margin-top: 16px; padding-top: 12px; color: var(--gold-pale); }

/* login page (Frappe's own page, in the Authority's colours) */
.for-login .page-card, .for-email-login .page-card, .for-forgot .page-card, .for-signup .page-card { border-top: 4px solid var(--gold); }
.page-card-head h4 { color: var(--teal-deep); }
.page-card .btn-primary, .page-card .btn-primary:focus { background: var(--gold); border-color: var(--gold); color: var(--teal-deep); font-weight: 700; }
.page-card .btn-primary:hover, .page-card .btn-primary:active { background: var(--gold-pale); border-color: var(--gold-pale); color: var(--teal-deep); }
.for-login .page-card .btn-login, .for-login .page-card .btn-login:focus { background: var(--teal); border-color: var(--teal); color: #fff; font-weight: 700; }
.for-login .page-card .btn-login:hover, .for-login .page-card .btn-login:active { background: var(--teal-deep); border-color: var(--teal-deep); color: #fff; }
.page-card .form-control:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--gold-pale); }
.page-card a { color: var(--teal); }
.forgot-password-message { display: none; } /* a reset link is an email, and this system sends none */

@media (min-width: 640px) {
  .rg-row { grid-template-columns: 1fr 1fr; }
  .choices { grid-template-columns: 1fr 1fr; }
  .rg-foot-grid { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: 200px 1fr; }
  .facts dt { margin-top: 0; padding: 8px 0; border-top: 1px solid var(--line); }
  .facts dd { padding: 8px 0; border-top: 1px solid var(--line); }
  .rg-page h1 { font-size: 32px; }
  .step-nav .btn { flex: 0 1 auto; min-width: 160px; }
}

@media print {
  .rg-ribbon, .rg-header, .rg-footer, .no-print, .rg-skip { display: none !important; }
  body { background: #fff; }
  .rg-cert { border: 0; padding: 0; }
}
