:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17213b;
  background: #eef3fb;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select, textarea { font: inherit; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at top left, #ffffff 0, #eef3fb 48%, #dae5f6 100%);
}

.auth-card {
  width: min(100%, 680px);
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid #c8d5e8;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(28, 54, 104, 0.14);
}

.brand { display: flex; align-items: center; gap: 28px; margin-bottom: 30px; }
.brand img { width: 180px; height: auto; border-radius: 14px; }
.eyebrow { margin: 0 0 6px; color: #1f3a8a; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
h1, h2 { margin: 0 0 10px; line-height: 1.12; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
p { line-height: 1.55; }
form { display: grid; gap: 10px; }
label { font-weight: 750; }
input, select, textarea {
  width: 100%; min-height: 52px; padding: 12px 15px; border: 2px solid #9aabc4; border-radius: 12px;
  color: #111827; background: #fff;
}
input:focus, select:focus, textarea:focus { border-color: #1f3a8a; outline: 3px solid rgba(31, 58, 138, .18); }
.otp { max-width: 250px; font-size: 1.7rem; letter-spacing: .32em; text-align: center; }
.help, .error { margin: 0 0 8px; font-size: .94rem; }
.help { color: #526078; }
.error { color: #a51224; font-weight: 700; }
input[aria-invalid="true"] { border-color: #b91c2c; background: #fff6f7; }
input:user-invalid, select:user-invalid, textarea:user-invalid, fieldset:has(input:user-invalid), .choice-box:has(input:user-invalid) { border-color: #b91c2c; background: #fff6f7; }
button {
  min-height: 50px; padding: 12px 18px; border: 0; border-radius: 12px; color: #fff; background: #1f3a8a;
  font-weight: 800; cursor: pointer;
}
button:hover { background: #172d6c; }
button:focus-visible { outline: 3px solid #f6b817; outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .58; }
.primary-link {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px; margin: 6px 6px 0 0;
  padding: 12px 18px; border-radius: 12px; color: #fff; background: #1f3a8a; font-weight: 800; text-decoration: none;
}
.primary-link:hover { background: #172d6c; }
.primary-link:focus-visible { outline: 3px solid #f6b817; outline-offset: 3px; }
.secondary { color: #1f3a8a; background: #e8eef9; }
.secondary:hover { background: #d8e3f6; }
.back { justify-self: start; min-height: auto; padding: 4px 0; color: #1f3a8a; background: transparent; }
.status { margin: 0 0 22px; padding: 14px 16px; border-radius: 12px; background: #edf6ff; border: 1px solid #aacbec; }
.authenticated { padding: 20px; border-radius: 16px; background: #edf8f0; border: 1px solid #9bcbaa; }
.authenticated button { margin: 6px 6px 0 0; }
.profile-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.profile-form .field { display: grid; align-content: start; gap: 8px; }
.profile-form.validated .field:has(:invalid) > label,
.profile-form.validated .field:has(:invalid) > .field-label { color: #b91c2c; }
.profile-form.validated .invalid-group > .field-label { color: #b91c2c; }
.profile-form.validated .invalid-group > .choice-box { border-color: #b91c2c; background: #fff6f7; }
.profile-form fieldset { min-width: 0; margin: 0; padding: 14px; border: 2px solid #9aabc4; border-radius: 12px; }
.profile-form legend { max-width: 100%; padding: 0 6px; font-weight: 750; white-space: nowrap; }
.field-label { font-weight: 750; }
.choice-box { display: grid; gap: 8px; padding: 14px; border: 2px solid #9aabc4; border-radius: 12px; }
.choice { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.choice input { width: auto; min-height: auto; }
.profile-form .wide, .profile-actions { grid-column: 1 / -1; }
.profile-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.profile-status { margin: 0; }
.dog-card { width: min(100%, 820px); }
.dog-list { display: grid; gap: 12px; margin: 14px 0; }
.saved-dog-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; border: 1px solid #c8d5e8; border-radius: 14px; background: #f8faff; }
.saved-dog-card h3, .saved-dog-card p { margin: 0; }
.saved-dog-card p { color: #526078; }
.dog-next { margin-top: 22px; }
.summary-list, .document-content { display: grid; gap: 10px; }
.summary-list details, #regulation-document, #privacy-document, #contract-document { margin: 12px 0; padding: 14px; border: 1px solid #c8d5e8; border-radius: 12px; background: #f8faff; }
summary { cursor: pointer; font-weight: 750; }
.readable-summary { margin-top: 14px; }
.readable-summary dl { display: grid; grid-template-columns: minmax(190px, .8fr) minmax(0, 1.2fr); margin: 0; border: 1px solid #d8e0ec; border-radius: 10px; overflow: hidden; }
.readable-summary dt, .readable-summary dd { margin: 0; padding: 11px 13px; border-bottom: 1px solid #d8e0ec; overflow-wrap: anywhere; }
.readable-summary dt { background: #eef3fa; font-weight: 750; }
.readable-summary dd { background: #fff; }
.readable-summary dt:nth-last-of-type(1), .readable-summary dd:last-of-type { border-bottom: 0; }
.summary-section { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid #d8e0ec; }
.summary-section h3 { margin: 0 0 10px; }
.declaration-form { margin-top: 22px; }
.declaration-form.validated .choice-box:has(:invalid), .declaration-form.validated fieldset:has(:invalid) { border-color: #b91c2c; }
.signed-confirmation { margin: 28px 0; padding: 28px; border: 1px solid #9bcbaa; border-radius: 18px; background: #edf8f0; text-align: center; }
.signed-confirmation img { display: block; width: min(100%, 280px); height: auto; margin: 0 auto 22px; border-radius: 14px; }
.signed-confirmation p { max-width: 620px; margin: 0 auto; font-weight: 650; }
.client-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 30px; }
.client-grid { display: grid; gap: 14px; margin: 14px 0 30px; }
.client-card { padding: 18px; border: 1px solid #c8d5e8; border-radius: 14px; background: #f8faff; }
.client-card h3, .client-card h4, .client-card p { margin: 0 0 9px; }
.request-status { display: inline-flex; padding: 6px 10px; border-radius: 999px; font-weight: 800; background: #e8eef9; }
.status-pending-confirmation { color: #6b4700; background: #fff3cd; }
.status-confirmed { color: #14532d; background: #dcfce7; }
.status-rejected { color: #7f1d1d; background: #fee2e2; }
.client-documents { margin-top: 16px; padding-top: 14px; border-top: 1px solid #d8e0ec; }
.client-documents ul { margin: 8px 0 0; padding-left: 22px; }
.empty-state { padding: 18px; border: 1px dashed #9aabc4; border-radius: 14px; color: #526078; }
footer { margin-top: 28px; padding-top: 20px; border-top: 1px solid #d8e0ec; color: #526078; font-size: .9rem; }
[hidden] { display: none !important; }

@media (max-width: 620px) {
  .auth-shell { padding: 0; place-items: stretch; }
  .auth-card { min-height: 100vh; border: 0; border-radius: 0; padding: 24px 20px; }
  .brand { align-items: flex-start; flex-direction: column; gap: 16px; }
  .brand img { width: 150px; }
  .otp { max-width: 100%; }
  .profile-form { grid-template-columns: 1fr; }
  .readable-summary dl { grid-template-columns: 1fr; }
  .readable-summary dt, .readable-summary dd { border-bottom: 0; }
  .readable-summary dd { border-bottom: 1px solid #d8e0ec; }
  .saved-dog-card { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
