:root {
  --ink: #17312f;
  --muted: #647875;
  --teal: #0f766e;
  --teal-dark: #0b5d57;
  --mint: #dff4ef;
  --cream: #f6f3eb;
  --white: #fff;
  --line: #dce7e4;
  --orange: #f59e0b;
  --shadow: 0 22px 60px rgba(21, 69, 64, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: #f9fbfa;
}

button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.background-orb {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(2px);
}
.orb-one { width: 400px; height: 400px; top: -170px; right: -80px; background: #d9f2ec; }
.orb-two { width: 260px; height: 260px; bottom: -100px; left: 42%; background: #fdf0cf; }

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr);
  min-height: 100vh;
}

.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 52px clamp(48px, 8vw, 120px);
  color: white;
  background:
    linear-gradient(145deg, rgba(5, 75, 69, .94), rgba(15, 118, 110, .87)),
    radial-gradient(circle at 80% 20%, #40b8a4, transparent 45%);
}

.brand { display: flex; align-items: center; gap: 12px; font-size: 21px; font-weight: 800; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--teal);
  background: white;
  font-size: 26px;
}
.eyebrow {
  margin: 0 0 12px;
  color: #3e9189;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.brand-panel .eyebrow { color: #a9e3d8; }
h1 { max-width: 680px; margin: 0; font-size: clamp(44px, 5.2vw, 76px); line-height: 1.02; letter-spacing: -.045em; }
.lead { max-width: 580px; margin-top: 24px; color: #d9f2ed; font-size: 19px; line-height: 1.6; }

.benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 48px; }
.benefits div { padding-top: 15px; border-top: 1px solid rgba(255,255,255,.24); }
.benefits span { color: #8dd9cb; font-size: 12px; font-weight: 800; }
.benefits p { margin: 8px 0 0; font-size: 14px; line-height: 1.45; }

.login-panel { display: grid; place-items: center; padding: 36px; }
.card { background: var(--white); border: 1px solid rgba(220,231,228,.8); border-radius: 26px; box-shadow: var(--shadow); }
.login-card { width: min(100%, 440px); padding: 42px; }
.login-card h2 { margin: 0 0 8px; font-size: 35px; letter-spacing: -.03em; }
.muted { color: var(--muted); line-height: 1.55; }
.login-card label { display: block; margin: 24px 0 8px; font-size: 13px; font-weight: 750; }
.login-card input {
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: .2s;
}
.login-card input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(15,118,110,.1); }
.phone-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.phone-input:focus-within { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(15,118,110,.1); }
.phone-input span { padding: 0 14px; color: var(--muted); border-right: 1px solid var(--line); }
.phone-input input { border: 0; border-radius: 0; box-shadow: none !important; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border: 0;
  border-radius: 12px;
  font-weight: 800;
  transition: transform .2s, background .2s;
}
.button:hover { transform: translateY(-1px); }
.primary { margin-top: 12px; color: white; background: var(--teal); }
.primary:hover { background: var(--teal-dark); }
.whatsapp { margin-top: 10px; color: #146c43; background: #e4f7ec; }
.form-error { min-height: 20px; margin: 10px 0 0; color: #b42318; font-size: 13px; }
.demo-note { margin: 18px 0 0; color: var(--muted); font-size: 12px; text-align: center; line-height: 1.5; }
.forgot-link {
  display: block;
  margin-top: 10px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 750;
  text-align: right;
  text-decoration: none;
}
.forgot-link:hover { text-decoration: underline; }
.mobile-brand { display: none; }

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 0 38px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
}
.topbar .brand-mark { color: white; background: var(--teal); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.compact { width: auto; min-height: 40px; padding: 8px 15px; }
.ghost { color: var(--teal); background: var(--mint); }
.icon-button { padding: 10px 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 11px; background: white; font-weight: 700; }

.portal-shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: calc(100vh - 76px); }
.sidebar { padding: 32px 24px; border-right: 1px solid var(--line); background: white; }
.pet-list { display: grid; gap: 8px; }
.pet-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
  text-align: left;
}
.pet-button:hover, .pet-button.active { border-color: #cce7e1; background: #edf8f5; }
.pet-avatar { display: grid; place-items: center; flex: 0 0 46px; height: 46px; border-radius: 14px; font-size: 23px; background: var(--cream); }
.pet-button strong, .pet-button small { display: block; }
.pet-button small { margin-top: 3px; color: var(--muted); }
.help-card { margin-top: 38px; padding: 20px; border-radius: 18px; background: var(--cream); }
.help-card p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.text-button { padding: 0; color: var(--teal); border: 0; background: transparent; font-weight: 800; }

.content { width: min(100%, 1080px); padding: 42px clamp(24px, 5vw, 70px) 80px; }
.pet-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 28px;
  color: white;
  border-radius: 24px;
  background: linear-gradient(125deg, #0b5d57, #159487);
  box-shadow: 0 18px 45px rgba(15,118,110,.19);
}
.hero-avatar { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 25px; background: rgba(255,255,255,.16); font-size: 48px; }
.pet-hero h1 { margin: 0 0 6px; font-size: 36px; }
.pet-hero p { margin: 0; color: #d8f4ef; }
.pet-facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.pet-facts span { padding: 7px 11px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; font-size: 12px; background: rgba(255,255,255,.1); }
.status-chip { margin-left: auto; align-self: flex-start; padding: 8px 12px; border-radius: 999px; color: #195c42; background: #dcfce7; font-size: 12px; font-weight: 800; }

.tabs { display: flex; gap: 8px; margin: 30px 0 22px; border-bottom: 1px solid var(--line); }
.tab { padding: 13px 17px; color: var(--muted); border: 0; border-bottom: 3px solid transparent; background: transparent; font-weight: 750; }
.tab.active { color: var(--teal); border-bottom-color: var(--teal); }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: 24px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.timeline { display: grid; gap: 14px; }
.event-card { display: grid; grid-template-columns: 88px 1fr; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: white; }
.event-date { display: grid; align-content: center; justify-items: center; padding: 20px 10px; color: var(--teal); background: #edf8f5; }
.event-date strong { font-size: 25px; }
.event-date span { font-size: 11px; font-weight: 800; text-transform: uppercase; }
.event-body { padding: 20px 22px; }
.event-top { display: flex; justify-content: space-between; gap: 15px; }
.event-body h3 { margin: 0; font-size: 17px; }
.event-type { color: var(--teal); font-size: 12px; font-weight: 800; }
.event-body p { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.doctor { margin-top: 12px !important; color: var(--ink) !important; font-weight: 650; }

.data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.data-card { padding: 21px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.data-card .card-top { display: flex; justify-content: space-between; gap: 12px; }
.data-card h3 { margin: 0; font-size: 17px; }
.data-card p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; font-size: 14px; }
.badge { height: fit-content; padding: 6px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.badge.ok { color: #17603e; background: #dcfce7; }
.badge.soon { color: #8a5408; background: #fef3c7; }
.prescription-list { margin: 16px 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.empty { padding: 40px; border: 1px dashed #bfd2ce; border-radius: 18px; color: var(--muted); text-align: center; background: white; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; padding: 13px 17px; color: white; border-radius: 12px; background: var(--ink); box-shadow: var(--shadow); opacity: 0; transform: translateY(14px); pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .login-layout { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .login-panel { min-height: 100vh; padding: 22px; }
  .mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 36px; }
  .mobile-brand .brand-mark { color: white; background: var(--teal); }
  .portal-shell { grid-template-columns: 1fr; }
  .sidebar { padding: 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .pet-list { display: flex; overflow-x: auto; }
  .pet-button { min-width: 190px; }
  .help-card { display: none; }
  .content { padding-top: 26px; }
}

@media (max-width: 580px) {
  .login-card { padding: 30px 24px; }
  .topbar { height: 68px; padding: 0 17px; }
  .topbar .brand span:last-child { display: none; }
  .portal-shell { min-height: calc(100vh - 68px); }
  .pet-hero { align-items: flex-start; padding: 22px; }
  .hero-avatar { width: 68px; height: 68px; border-radius: 19px; font-size: 36px; }
  .pet-hero h1 { font-size: 29px; }
  .status-chip { display: none; }
  .tabs { overflow-x: auto; }
  .event-card { grid-template-columns: 68px 1fr; }
  .event-body { padding: 17px; }
  .event-top { display: block; }
  .event-type { display: block; margin-top: 5px; }
  .data-grid { grid-template-columns: 1fr; }
}
