@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* ── Design tokens ─────────────────────────────────────────────────────────── */
:root {
  --sage:        #89C5A8;
  --sage-light:  #C5E0D4;
  --sage-dark:   #5FA688;
  --peach:       #F5B8A0;
  --peach-light: #FAE0D4;
  --lavender:    #B8A8E0;
  --lavender-light: #DDD6F5;
  --rose:        #F0B8C0;
  --butter:      #F5E090;
  --mint:        #A8E0D0;

  --bg:          #FBF9F5;
  --card:        #FFFFFF;
  --text:        #3D3A38;
  --text-muted:  #9A968F;
  --border:      #EDE8E0;

  --shadow-sm:   0 2px 12px rgba(0,0,0,.06);
  --shadow:      0 6px 24px rgba(0,0,0,.09);
  --shadow-lg:   0 12px 40px rgba(0,0,0,.14);

  --radius:      22px;
  --radius-sm:   14px;
  --radius-xs:   8px;

  --font:        'Nunito', sans-serif;
}

/* ── Reset & base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

img { max-width: 100%; display: block; }

/* ── Banner ────────────────────────────────────────────────────────────────── */
.banner {
  background: linear-gradient(135deg, #F5C4B0 0%, #CCBAF0 45%, #8FC9B0 100%);
  padding: 3.5rem 2rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.banner::before {
  content: '🐾';
  position: absolute;
  font-size: 14rem;
  opacity: .06;
  top: -3rem;
  left: -3rem;
  line-height: 1;
  pointer-events: none;
}

.banner::after {
  content: '🐾';
  position: absolute;
  font-size: 10rem;
  opacity: .06;
  bottom: -2rem;
  right: -1rem;
  line-height: 1;
  pointer-events: none;
}

.banner-logo {
  font-size: clamp(2.6rem, 6vw, 4rem);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 3px 12px rgba(0,0,0,.18);
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: .4rem;
}

.banner-logo span { color: var(--butter); }

.banner-slogan {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 600;
  color: rgba(255,255,255,.9);
  text-shadow: 0 1px 6px rgba(0,0,0,.15);
  max-width: 480px;
  margin: 0 auto .8rem;
}

.banner-badge {
  display: inline-block;
  background: rgba(255,255,255,.25);
  backdrop-filter: blur(6px);
  border: 1.5px solid rgba(255,255,255,.4);
  border-radius: 50px;
  padding: .35rem 1.1rem;
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
}

/* ── Section title ─────────────────────────────────────────────────────────── */
.section-title {
  text-align: center;
  padding: 2.8rem 1rem 1.6rem;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 800;
  color: var(--text);
}

.section-title span { color: var(--sage-dark); }

/* ── Dog grid ──────────────────────────────────────────────────────────────── */
.dogs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.8rem;
  max-width: 1100px;
  margin: 0 auto 4rem;
  padding: 0 1.5rem;
}

/* ── Dog card ──────────────────────────────────────────────────────────────── */
.dog-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease;
  cursor: default;
  display: flex;
  flex-direction: column;
}

.dog-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.dog-card__photo {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: var(--border);
}

.dog-card__photo-placeholder {
  width: 100%;
  height: 220px;
  background: linear-gradient(135deg, var(--peach-light), var(--lavender-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.dog-card__body {
  padding: 1.2rem 1.4rem 1.4rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dog-card__name {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: .15rem;
}

.dog-card__meta {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .7rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.dog-card__blurb {
  font-size: .95rem;
  color: var(--text);
  flex: 1;
  margin-bottom: 1rem;
  line-height: 1.55;
}

/* Card accent stripe — each card gets a different pastel top border */
.dog-card:nth-child(3n+1) { border-top: 4px solid var(--peach); }
.dog-card:nth-child(3n+2) { border-top: 4px solid var(--lavender); }
.dog-card:nth-child(3n+3) { border-top: 4px solid var(--sage); }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .6rem 1.3rem;
  border-radius: 50px;
  border: none;
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, filter .15s;
  text-decoration: none;
}

.btn:hover  { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--sage);
  color: #fff;
  width: 100%;
  justify-content: center;
  font-size: 1rem;
  padding: .75rem;
}

.btn-primary:hover { filter: brightness(1.06); }

.btn-bark {
  background: var(--peach);
  color: var(--text);
  font-size: 1rem;
  padding: .65rem 1.5rem;
}

.btn-bark.shaking {
  animation: shake .4s ease;
}

.btn-close {
  background: var(--rose);
  color: var(--text);
}

.btn-login {
  background: var(--sage);
  color: #fff;
  width: 100%;
  justify-content: center;
  padding: .85rem;
  font-size: 1.05rem;
}

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(40,35,30,.55);
  backdrop-filter: blur(5px);
  z-index: 100;
  padding: 1.5rem;
  overflow-y: auto;
  align-items: flex-start;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 580px;
  width: 100%;
  margin: auto;
  overflow: hidden;
  animation: popIn .25s cubic-bezier(.34,1.56,.64,1);
}

.modal__photo {
  width: 100%;
  height: 300px;
  object-fit: cover;
  background: var(--border);
}

.modal__photo-placeholder {
  width: 100%;
  height: 300px;
  background: linear-gradient(135deg, var(--peach-light), var(--lavender-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
}

.modal__body {
  padding: 1.8rem 2rem 2rem;
}

.modal__name {
  font-size: 1.9rem;
  font-weight: 900;
  margin-bottom: .2rem;
}

.modal__meta {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 1rem;
}

.modal__desc {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 1.6rem;
}

.modal__actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: .85rem;
  border-top: 1px solid var(--border);
}

/* ── Login page ────────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #F5C4B0 0%, #CCBAF0 50%, #8FC9B0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2.8rem 2.4rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  animation: popIn .3s cubic-bezier(.34,1.56,.64,1);
}

.login-logo {
  font-size: 2.2rem;
  font-weight: 900;
  margin-bottom: .3rem;
}

.login-logo span { color: var(--sage-dark); }

.login-sub {
  font-size: .95rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.form-group {
  text-align: left;
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 700;
  font-size: .88rem;
  color: var(--text);
  margin-bottom: .35rem;
}

.form-group input {
  width: 100%;
  padding: .75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  transition: border-color .2s;
  outline: none;
  background: var(--bg);
}

.form-group input:focus {
  border-color: var(--sage);
}

.error-msg {
  color: #d94f4f;
  font-size: .88rem;
  font-weight: 600;
  margin-top: .8rem;
  min-height: 1.2em;
}

/* ── Keyframes ─────────────────────────────────────────────────────────────── */
@keyframes popIn {
  from { opacity: 0; transform: scale(.88) translateY(12px); }
  to   { opacity: 1; transform: scale(1)  translateY(0); }
}

@keyframes shake {
  0%,100% { transform: rotate(0deg); }
  20%     { transform: rotate(-8deg); }
  40%     { transform: rotate(8deg); }
  60%     { transform: rotate(-6deg); }
  80%     { transform: rotate(6deg); }
}

/* ── Loading state ─────────────────────────────────────────────────────────── */
.loading {
  text-align: center;
  padding: 4rem 1rem;
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 600;
}

.loading span {
  display: inline-block;
  animation: bounce 1s infinite alternate;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to   { transform: translateY(-8px); }
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .dogs-grid { grid-template-columns: 1fr; gap: 1.2rem; padding: 0 1rem; }
  .modal__body { padding: 1.4rem 1.2rem 1.6rem; }
  .modal__photo, .modal__photo-placeholder { height: 220px; }
  .modal__name { font-size: 1.5rem; }
}
