/* ---------------------------------------------------
   Global reset & base styles
----------------------------------------------------*/
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #f5f0e8;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #000;
  line-height: 1.5;
}

/* Utility: hidden by search filter (preserves grid layout) */
.hidden { display: none !important; }

/* ---------------------------------------------------
   Landing header
----------------------------------------------------*/
.site-header {
  max-width: 1200px;
  margin: 2.5rem auto 0;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo { font-size: 1.75rem; font-weight: 700; }

.sign-in-link {
  text-decoration: none;
  color: #000;
  font-size: 1rem;
  font-weight: 500;
}

/* ---------------------------------------------------
   Landing hero
----------------------------------------------------*/
.hero {
  display: flex;
  align-items: center;
  max-width: 1200px;
  margin: 7rem auto 2rem;
  padding: 0 1.5rem;
  gap: 2rem;
}

.hero-text          { flex: 1 1 50%; max-width: 600px; }
.hero-text h1       { font-size: 3.5rem; line-height: 1.15; margin-bottom: 1rem; font-weight: 700; }
.subheading         { font-size: 1.125rem; color: #333; margin-bottom: 1.5rem; }

.cta-button {
  display: inline-flex;
  align-items: center;
  background: #000;
  color: #fff;
  border: none;
  font-size: 1rem;
  padding: .75rem 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 2rem;
  text-decoration: none;
  transition: background .2s;
}
.cta-button:hover { background: #333; }

.hero-image         { flex: 1 1 50%; display: flex; justify-content: center; }
.hero-image img     { max-width: 100%; height: auto; max-height: 500px; }

/* Animations */
.fade-word, .fade-subheading { opacity: 0; animation: fadeInUp .5s ease forwards; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------
   Landing responsive
----------------------------------------------------*/
@media (max-width: 1100px) {
  .hero           { margin-top: 5rem; }
  .hero-image     { display: none; }
  .hero-text h1   { font-size: 2.75rem; }
  .subheading     { font-size: 1rem; }
}

@media (max-width: 600px) {
  .site-header    { margin-top: 1.5rem; }
  .hero           { margin-top: 3rem; }
  .hero-text h1   { font-size: 2rem; }
  .subheading     { font-size: .95rem; }
  .cta-button     { font-size: .9rem; padding: .65rem 1.25rem; }
}

/* ---------------------------------------------------
   Login page
----------------------------------------------------*/
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 20px;
  padding: 2.5rem 2rem 3rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.05);
}

.login-card h2 {
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-card label {
  display: block;
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: .25rem;
}

.login-card input {
  width: 100%;
  padding: .75rem 1rem;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: #fafafa;
  margin-bottom: 1rem;
  transition: border-color .15s, background-color .15s;
}
.login-card input:focus { border-color: #000; background: #fff; outline: none; }

.primary-btn {
  width: 100%;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: .8rem;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s;
}
.primary-btn:hover { background: #333; }
.primary-btn:disabled { background: #999; cursor: not-allowed; }

.secondary-actions { display: flex; justify-content: center; gap: 1.5rem; margin-top: 1rem; }
.secondary-link    { font-size: .875rem; color: #555; text-decoration: none; background: none; border: none; cursor: pointer; font-family: inherit; }
.secondary-link:hover { text-decoration: underline; }

/* Inline form errors */
.form-error {
  font-size: .875rem;
  color: #d1242f;
  margin-bottom: .75rem;
  text-align: center;
}

.form-message {
  font-size: .875rem;
  margin: .75rem 0;
  text-align: center;
}
.form-message.ok { color: #1a7f37; }

/* Forgot-password panel */
.reset-panel {
  margin-top: 1.5rem;
  text-align: center;
}
.reset-panel p:first-child {
  font-size: .9rem;
  color: #555;
  margin-bottom: 1rem;
}
.reset-panel input {
  width: 100%;
  padding: .75rem 1rem;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: #fafafa;
  margin-bottom: .75rem;
}
.reset-panel input:focus { border-color: #000; background: #fff; outline: none; }
.reset-actions {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  align-items: center;
}
.reset-actions .primary-btn { max-width: 280px; }

/* ===================================================
   DASHBOARD
====================================================*/

.dashboard-body {
  background: #f5f0e8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.dash-header {
  width: 100%;
  max-width: 1200px;
  margin: 1.5rem auto 0;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dash-logo { font-size: 1.75rem; font-weight: 700; }

.dash-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.new-report-btn {
  font-size: .875rem;
  font-weight: 600;
  color: #000;
  text-decoration: none;
  padding: .5rem 1rem;
  border: 1px solid #ccc;
  border-radius: 10px;
  transition: background .15s, border-color .15s;
}
.new-report-btn:hover { background: #fff; border-color: #000; }

/* Avatar / sign-out button */
.avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #000;
  cursor: pointer;
  position: relative;
  transition: background .2s;
}
.avatar-btn:hover { background: #333; }
.avatar-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M4 21v-2a4 4 0 0 1 3-3.87'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E") center/20px 20px no-repeat;
}

/* ---------- Search ---------- */
.dash-search {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding: 0 1.5rem;
  display: flex;
  justify-content: center;
}

.dash-search form {
  width: 100%;
  max-width: 1200px;
  display: flex;
}

.dash-search input[type="search"] {
  flex: 1 1 auto;
  padding: .75rem 1rem;
  border: 1px solid #ccc;
  border-right: none;
  border-radius: 12px 0 0 12px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}
.dash-search input[type="search"]:focus { outline: none; border-color: #000; }

.dash-search button {
  flex: 0 0 52px;
  display: grid;
  place-items: center;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  border-radius: 0 12px 12px 0;
  cursor: pointer;
  transition: background .2s;
}
.dash-search button:hover { background: #333; }

/* ---------- Tile grid: 3 → 2 → 1 ---------- */
.tile-grid {
  width: 100%;
  max-width: 1200px;
  margin: 2rem auto 3rem;
  padding: 0 1.5rem;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 1200px)                       { .tile-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 600px) and (max-width:1199px) { .tile-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 599px)                        { .tile-grid { grid-template-columns: 1fr; } }

/* ---------- Tile ---------- */
.tile {
  position: relative;
  padding: 1.5rem;
  border-radius: 24px;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: var(--bg) center/cover no-repeat, #333;
  transition: transform .25s ease;
  text-decoration: none;
  color: inherit;
}

.tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%);
  pointer-events: none;
}

.tile > * { position: relative; z-index: 1; }

.tile-label {
  font-size: clamp(.8rem, 1vw + .4rem, 1rem);
  font-weight: 500;
  color: #fff;
}
.tile-headline {
  font-size: clamp(1.1rem, 1.2vw + .8rem, 1.6rem);
  font-weight: 700;
  line-height: 1.25;
  margin-top: .25rem;
  color: #fff;
}
.tile-read {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  font-size: .9rem;
  font-weight: 500;
  color: #fff;
  opacity: .9;
  transition: opacity .25s;
  z-index: 1;
}
.tile:hover .tile-read { opacity: 1; }
.tile:hover { transform: translateY(-4px); }

/* ---------- Dashboard mobile ---------- */
@media (max-width: 600px) {
  .dash-header { margin-top: 1rem; }
  .dash-search { margin-top: 1.5rem; }
}
