/**
 * styles.css
 * Custom styles that complement Tailwind + OrCoRe dark page mode.
 */

html {
  scroll-behavior: smooth;
}

html.dark {
  color-scheme: dark;
}

.custom-scroll::-webkit-scrollbar {
  width: 6px;
}
.custom-scroll::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}
html.dark .custom-scroll::-webkit-scrollbar-track {
  background: #1f2937;
}
.custom-scroll::-webkit-scrollbar-thumb {
  background: #1a5f2a;
  border-radius: 3px;
}

#threat-map, #group-map {
  height: 400px;
  width: 100%;
  border-radius: 0.75rem;
  z-index: 0;
}

input:focus, textarea:focus, select:focus {
  outline: none;
}

@media print {
  nav, footer, .no-print, [data-theme-toggle] {
    display: none !important;
  }
  body {
    background: white;
    color: black;
  }
  .print-break {
    page-break-before: always;
  }
}

@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
#app-toast {
  animation: slideIn 0.3s ease-out;
}

.hover-lift {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.severity-low { @apply bg-green-100 text-green-800; }
.severity-medium { @apply bg-amber-100 text-amber-800; }
.severity-high { @apply bg-orange-100 text-orange-800; }
.severity-critical { @apply bg-red-100 text-red-800; }

html.dark body {
  background-color: #0b1220;
  color: #e5e7eb;
}

html.dark .bg-white {
  background-color: #111827 !important;
}
html.dark .bg-gray-100 {
  background-color: #0b1220 !important;
}
html.dark .text-gray-700,
html.dark .text-gray-800,
html.dark .text-gray-600,
html.dark .text-prep-dark {
  color: #e5e7eb !important;
}
html.dark .text-gray-500,
html.dark .text-gray-400 {
  color: #9ca3af !important;
}
html.dark .border-gray-300,
html.dark .border-amber-200 {
  border-color: #374151 !important;
}
html.dark input,
html.dark textarea,
html.dark select {
  background-color: #1f2937;
  color: #f9fafb;
  border-color: #4b5563;
}
html.dark .bg-amber-50 {
  background-color: #422006 !important;
  color: #fde68a;
}
html.dark footer {
  background-color: #020617;
}

.field-error {
  color: #b91c1c;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}
html.dark .field-error {
  color: #fca5a5;
}

input.invalid, select.invalid {
  border-color: #dc2626 !important;
}

.account-option {
  border: 2px solid #d1d5db;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.account-option.selected {
  border-color: #8a6a2f;
  background-color: #f4efe4;
}

.addr-block {
  border: 1px solid var(--line, #e4e2db);
  border-radius: 0.75rem;
  padding: 0.85rem 0.9rem 1rem;
  background: #fafaf7;
}
.addr-postcode-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.addr-find-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  background: #8a6a2f;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: 0.5rem;
  border: 0;
}
.addr-find-btn:hover,
.addr-find-btn:focus {
  background: #6f5424;
}
.addr-find-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}
.addr-status {
  font-size: 0.75rem;
  margin-top: 0.4rem;
  color: #4b4b4b;
}
.addr-status.is-ok { color: #1a5f2a; }
.addr-status.is-error { color: #b91c1c; }
.addr-suggest {
  margin-top: 0.45rem;
  border: 1px solid var(--line, #e4e2db);
  border-radius: 0.5rem;
  background: #fff;
  max-height: 10.5rem;
  overflow: auto;
}
.addr-suggest button {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 0.78rem;
  line-height: 1.35;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-bottom: 1px solid var(--line, #e4e2db);
  background: transparent;
  color: inherit;
}
.addr-suggest button:last-child { border-bottom: 0; }
.addr-suggest button:hover,
.addr-suggest button:focus {
  background: #f4efe4;
}
html.dark .addr-block { background: #111827; border-color: #3a3a3a; }
html.dark .addr-suggest { background: #0b1220; border-color: #3a3a3a; }
html.dark .addr-suggest button { border-bottom-color: #3a3a3a; }
html.dark .addr-suggest button:hover,
html.dark .addr-suggest button:focus { background: #1f2937; }
html.dark .addr-status.is-ok { color: #86efac; }
html.dark .addr-status.is-error { color: #fca5a5; }

/* Verdeon-inspired theme: warm paper, near-black type, bronze CTAs */
:root {
  --paper: #f3f2ee;
  --paper-deep: #eceae4;
  --ink: #141414;
  --ink-soft: #4b4b4b;
  --line: #e4e2db;
  --bronze: #8a6a2f;
  --bronze-dark: #6f5424;
  --card: #ffffff;
}

body.bg-gray-100 {
  background: var(--paper) !important;
  color: var(--ink);
  font-family: "Georgia", "Times New Roman", serif;
}
body.bg-gray-100 h1,
body.bg-gray-100 h2,
body.bg-gray-100 h3,
body.bg-gray-100 .font-bold,
body.bg-gray-100 .font-extrabold,
body.bg-gray-100 .font-semibold {
  letter-spacing: -0.03em;
  color: var(--ink);
}
body.bg-gray-100 p,
body.bg-gray-100 li,
body.bg-gray-100 label,
body.bg-gray-100 input,
body.bg-gray-100 textarea,
body.bg-gray-100 select,
body.bg-gray-100 button,
body.bg-gray-100 a,
body.bg-gray-100 span {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

nav.bg-prep-dark {
  background: #ffffff !important;
  color: var(--ink) !important;
  box-shadow: none;
  border-bottom: 1px solid var(--line);
}
nav.bg-prep-dark a,
nav.bg-prep-dark span,
nav.bg-prep-dark .text-green-300,
nav.bg-prep-dark .text-gray-300,
nav.bg-prep-dark .text-white,
nav.bg-prep-dark .text-slate-500,
nav.bg-prep-dark .text-slate-600,
nav.bg-prep-dark .text-indigo-700 {
  color: #3f3f3f !important;
}
nav.bg-prep-dark .font-bold,
nav.bg-prep-dark .text-indigo-600 {
  color: var(--ink) !important;
}
nav.bg-prep-dark a.rounded-full,
nav.bg-prep-dark a.bg-indigo-50 {
  background: transparent !important;
  border-radius: 0 !important;
  font-weight: 500;
}
nav.bg-prep-dark a.bg-indigo-50,
nav.bg-prep-dark a.font-medium {
  color: var(--ink) !important;
  box-shadow: inset 0 -2px 0 var(--bronze);
}
nav.bg-prep-dark [data-theme-toggle] {
  background: #f4f3ef !important;
  color: var(--ink) !important;
  border: 1px solid var(--line);
}
nav.bg-prep-dark [data-logout],
nav.bg-prep-dark a.bg-indigo-600 {
  background: var(--ink) !important;
  color: #fff !important;
  border-radius: 6px !important;
}
.bg-prep-green,
button.bg-prep-green,
a.bg-prep-green {
  background-color: var(--bronze) !important;
  color: #fff !important;
  border-radius: 6px !important;
}
button.bg-prep-green:hover,
a.bg-prep-green:hover {
  background-color: var(--bronze-dark) !important;
}
.text-prep-green,
.text-prep-dark,
.text-indigo-600,
.text-indigo-700 {
  color: var(--ink) !important;
}
.text-prep-green.hover\:underline:hover,
a.text-prep-green {
  color: var(--bronze-dark) !important;
}
footer.bg-prep-dark {
  background: var(--ink) !important;
  color: #cfcfc7 !important;
}
.bg-green-50,
.bg-indigo-50 {
  background-color: #f7f4ec !important;
  border-color: #e4d8b8 !important;
}
.text-green-700,
.text-green-600 {
  color: #3d4a32 !important;
}
.bg-white {
  background: var(--card) !important;
  border: 1px solid var(--line);
  box-shadow: none !important;
  border-radius: 14px;
}
nav.bg-white,
.bg-white.border-t {
  border-radius: 0;
}
#login-form-card,
#signup-form-card {
  border: 1px solid var(--line);
  box-shadow: 0 24px 50px -32px rgba(20, 20, 20, 0.28);
}
.md\:hidden.bg-white a.text-indigo-700 {
  color: var(--ink) !important;
  box-shadow: inset 0 -2px 0 var(--bronze);
}

.hero-badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: #fff;
  color: #666;
  padding: 4px 10px;
  border-radius: 999px;
}
.btn-bronze {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bronze);
  color: #fff;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 6px;
  border: 0;
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: var(--ink);
  padding: 10px 12px;
}
.sketch-panel {
  position: relative;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.88), rgba(243,242,238,0.65)),
    repeating-linear-gradient(0deg, transparent, transparent 11px, rgba(20,20,20,0.035) 12px),
    repeating-linear-gradient(90deg, transparent, transparent 11px, rgba(20,20,20,0.03) 12px);
  min-height: 220px;
  overflow: hidden;
}
.sketch-panel svg {
  width: 100%;
  height: 100%;
  opacity: 0.55;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
}
.stat-row div {
  padding: 18px 16px;
  text-align: center;
  border-right: 1px solid var(--line);
}
.stat-row div:last-child { border-right: 0; }
.stat-row strong {
  display: block;
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}
.nav-sign {
  border: 1px solid var(--line) !important;
  background: #fff !important;
  color: var(--ink) !important;
  border-radius: 6px !important;
  padding: 6px 12px !important;
}
 .page-photo {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--line);
}
.page-photo.tall { height: 280px; }
.photo-caption {
  font-size: 11px;
  color: #6b6b6b;
  margin: 6px 0 16px;
}
.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0 24px;
}
.photo-grid img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.nav-join {
  background: var(--ink) !important;
  color: #fff !important;
  border-radius: 6px !important;
  padding: 6px 12px !important;
}

html.dark body {
  background: #121212 !important;
  color: #ececec;
}
html.dark .bg-white { background: #1b1b1b !important; border-color: #2c2c2c; }
html.dark nav.bg-prep-dark { background: #161616 !important; border-color: #2c2c2c; }
html.dark .account-option { border-color: #3a3a3a; }
html.dark .account-option.selected {
  background-color: #2a2418;
  border-color: #c4a15a;
}


.hero-main {
  padding-top: 1.25rem;
  padding-bottom: 0.75rem;
}
.hero-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  gap: 1.25rem;
}
.hero-auth {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.25rem;
  width: 100%;
}
.hero-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  width: 100%;
  height: auto;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
  align-self: flex-start;
}
.nav-logo {
  height: 36px;
  width: 36px;
  display: block;
  object-fit: cover;
  border-radius: 50%;
  background: transparent;
}
.site-version {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 1px 7px 0;
  border: 1px solid var(--line, #e4e2db);
  border-radius: 4px;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.4;
  color: #6b6b6b;
  vertical-align: middle;
}
nav.bg-prep-dark .site-version {
  color: #6b6b6b !important;
}
.hero-logo img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}
.about-copy {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #333;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
}
.about-copy-body {
  padding: 1rem 1.35rem 1.25rem;
}
.about-copy p { margin: 0 0 0.9rem; }
.about-copy p:last-child { margin-bottom: 0; }
.hero-right {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}
.hero-banner,
.about-banner {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.85rem 0.75rem 0.75rem;
  border: 4px solid #111;
  border-radius: 6px;
  background:
    linear-gradient(#8b1c1c, #8b1c1c) top / 100% 6px no-repeat,
    linear-gradient(#8b1c1c, #8b1c1c) bottom / 100% 6px no-repeat,
    #161616;
  color: #f4f4f4;
  font-family: Impact, "Arial Black", "Franklin Gothic Heavy", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  text-align: center;
  box-shadow: inset 0 0 0 3px #3d3a2c;
  cursor: default;
  pointer-events: none;
  user-select: none;
}
.about-block {
  display: block;
  width: 100%;
  max-width: 100%;
  flex: 0 0 auto;
  clear: both;
  float: none;
  margin: 0;
}
.about-block .hero-banner {
  margin: 0;
}
#auth-container { width: 100%; }
#login-form-card,
#signup-form-card,
.about-copy {
  margin-bottom: 0 !important;
  padding: 0 !important;
  overflow: hidden;
}
#login-form-card .hero-banner,
#signup-form-card .hero-banner,
.about-copy .hero-banner {
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  box-sizing: border-box;
}
#login-form-card > :not(.hero-banner),
#signup-form-card > :not(.hero-banner) {
  margin-left: 1.5rem;
  margin-right: 1.5rem;
}
#login-form-card > .hero-banner + *,
#signup-form-card > .hero-banner + * {
  margin-top: 1rem;
}
#login-form-card > :last-child,
#signup-form-card > :last-child {
  margin-bottom: 1.5rem;
}
@media (min-width: 768px) {
  .hero-stack {
    flex-direction: column;
  }
  .hero-auth {
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: nowrap;
  }
  .hero-logo,
  .hero-right {
    flex: 1 1 0;
    width: 50%;
    max-width: 50%;
  }
  .hero-logo {
    align-self: flex-start;
    height: auto;
  }
  .about-block {
    display: block;
    width: 100%;
    max-width: 100%;
    flex-basis: 100%;
  }
}

.emergency-note {
  font-size: 1.125rem;
  line-height: 1.5;
  color: #3f3f3f;
  margin-top: 1rem !important;
  margin-bottom: 0;
}
.emergency-note strong { font-size: 1.2em; }
footer.bg-prep-dark {
  margin-top: 0.75rem !important;
}
