@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --ink: #2b1213;
  --muted: #877172;
  --brand: #b31118;
  --brand-dark: #8a0a10;
  --line: #f4e5e6;
  --surface: rgba(255, 255, 255, .92);
  --shadow: 0 18px 50px rgba(110, 31, 31, .10);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  background: radial-gradient(ellipse at 8% 4%, rgba(179, 17, 24, .15), transparent 32rem),
              radial-gradient(ellipse at 95% 65%, rgba(222, 139, 143, .15), transparent 30rem),
              #fcf9f9;
  color: #332525;
  font-family: 'Prompt', 'Segoe UI', sans-serif;
  line-height: 1.6;
}

.container {
  width: min(100% - 32px, 760px);
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 0 18px;
}

.header {
  position: relative;
  overflow: hidden;
  padding: 30px 32px;
  margin-bottom: 22px;
  color: white;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 26px;
  background: linear-gradient(125deg, #8a0a10 0%, #b31118 55%, #f25057 100%);
  box-shadow: 0 18px 40px rgba(179, 17, 24, .23);
}

.header::after {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  right: -55px;
  top: -105px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255, 255, 255, .06), 
              0 0 0 58px rgba(255, 255, 255, .04);
  pointer-events: none;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  margin-bottom: 13px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .13);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .02em;
}

.header h1 {
  position: relative;
  z-index: 1;
  margin: 0 0 4px;
  font-size: clamp(25px, 5vw, 34px);
  font-weight: 700;
  letter-spacing: -.035em;
}

.header p {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0;
  color: rgba(255, 255, 255, .9);
  font-size: 14px;
}

#loginPage, 
#registerPage {
  max-width: 490px;
  margin: 0 auto;
}

.box {
  padding: 24px;
  margin-bottom: 14px;
  border: 1px solid rgba(244, 226, 227, .9);
  border-radius: 21px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

#loginPage .box, 
#registerPage .box {
  padding: 30px;
}

.box h3 {
  margin: 0 0 17px;
  color: var(--ink);
  font-size: 23px;
  font-weight: 600;
}

.login-hint {
  padding: 10px 12px;
  margin: 14px 0 0;
  border-radius: 11px;
  background: #fcf2f2;
  color: #9a7375;
  font-size: 12px;
  text-align: center;
}

.register-prompt {
  margin: 15px 0 2px;
  color: var(--muted);
  font-size: 14px;
}

.nav {
  position: sticky;
  z-index: 5;
  top: 12px;
  display: flex;
  gap: 6px;
  padding: 7px;
  margin-bottom: 22px;
  border: 1px solid rgba(244, 226, 227, .9);
  border-radius: 17px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 8px 25px rgba(110, 31, 31, .08);
  backdrop-filter: blur(14px);
}

.nav button {
  flex: 1;
  min-width: 0;
  padding: 10px 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #92696a;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.nav button:hover {
  background: #fcf2f2;
  color: var(--brand);
}

.nav button.active {
  background: #fae5e6;
  color: var(--brand);
  font-weight: 600;
}

.page {
  display: none;
}

.show {
  display: block;
  animation: fade-up .28s ease both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.grid .box {
  position: relative;
  overflow: hidden;
  min-height: 115px;
  padding: 19px 21px;
}

.grid .box::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -40px;
  width: 105px;
  height: 105px;
  border-radius: 50%;
  background: rgba(179, 17, 24, .08);
}

.grid small {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
}

.grid h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--brand);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
}

.title {
  margin: 25px 2px 13px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 15px;
  padding: 13px;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(110, 31, 31, .055);
  transition: transform .2s ease, box-shadow .2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 27px rgba(110, 31, 31, .11);
}

.card img {
  flex: 0 0 96px;
  width: 96px;
  height: 96px;
  border-radius: 13px;
  object-fit: cover;
  background: #f8eded;
}

.info {
  flex: 1;
  min-width: 0;
  padding: 1px 2px;
}

.info h4 {
  margin: 5px 0;
  color: #2b1213;
  font-size: 16px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.info small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.info p {
  margin: 4px 0 7px;
  color: #80595a;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border: 0;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.lost {
  background: #fff0ee;
  color: #c94c43;
}

.found {
  background: #e8f8ef;
  color: #218452;
}

.pending {
  background: #fff6df;
  color: #a66b0a;
}

.done {
  background: #fae5e6;
  color: #b31118;
}

input, 
select, 
textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  margin: 8px 0;
  border: 1px solid #efdfe0;
  border-radius: 12px;
  outline: none;
  background-color: #fff;
  color: #4d2627;
  font: inherit;
  font-size: 14px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input::placeholder, 
textarea::placeholder {
  color: #bda0a2;
}

input:focus, 
select:focus, 
textarea:focus {
  border-color: #f25057;
  box-shadow: 0 0 0 4px rgba(179, 17, 24, .12);
}

#search, 
#post {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

#search .title, 
#post .title {
  margin: 0 0 15px;
}

.search-spacer {
  height: 12px;
}

button.btn {
  width: 100%;
  min-height: 45px;
  padding: 10px 16px;
  margin-top: 8px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #b31118, #e63038);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 6px 14px rgba(179, 17, 24, .18);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

button.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 9px 18px rgba(179, 17, 24, .24);
}

button.btn:active {
  transform: translateY(0);
}

button.btn.gray {
  background: #f8eef0;
  color: #7b5256;
  box-shadow: none;
}

button.btn.red {
  background: #fff0ee;
  color: #c94c43;
  box-shadow: none;
}

button.btn.green {
  background: #e8f8ef;
  color: #218452;
  box-shadow: none;
}

#account .box p {
  margin: 7px 0;
  color: #8c6668;
  font-size: 14px;
  overflow-wrap: anywhere;
}

#account .box h3 {
  margin-bottom: 5px;
}

.footer {
  padding: 16px 0 4px;
  color: #a8898a;
  font-size: 12px;
  text-align: center;
}

.hidden {
  display: none !important;
}

small {
  color: var(--muted);
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.card-actions .btn {
  margin-top: 0;
  min-height: 36px;
  padding: 6px 12px;
}

/* Media Queries */
@media (min-width: 768px) {
  .container {
    padding-top: 42px;
  }
  
  .header {
    padding: 36px 40px;
  }
  
  #homeList, 
  #searchList {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  
  #homeList .card, 
  #searchList .card {
    height: 100%;
    margin: 0;
  }
}

@media (max-width: 520px) {
  .container {
    width: min(100% - 22px, 760px);
    padding-top: 16px;
  }
  
  .header {
    padding: 24px 22px;
    border-radius: 21px;
  }
  
  .header p {
    font-size: 13px;
  }
  
  #loginPage .box, 
  #registerPage .box {
    padding: 23px;
  }
  
  .box {
    padding: 18px;
  }
  
  .nav {
    top: 7px;
    gap: 3px;
    margin-bottom: 16px;
  }
  
  .nav button {
    padding: 9px 5px;
    font-size: 12px;
  }
  
  .grid {
    gap: 10px;
  }
  
  .grid .box {
    min-height: 103px;
    padding: 15px;
  }
  
  .grid h2 {
    font-size: 28px;
  }
  
  .title {
    margin-top: 21px;
    font-size: 18px;
  }
  
  #search, 
  #post {
    padding: 17px;
    border-radius: 17px;
  }
  
  .card {
    gap: 11px;
    padding: 10px;
    border-radius: 15px;
  }
  
  .card img {
    flex-basis: 76px;
    width: 76px;
    height: 76px;
    border-radius: 11px;
  }
  
  .info h4 {
    font-size: 14px;
  }
  
  .info small {
    font-size: 11px;
  }
  
  .info p {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}