/* ══════════════════════════════════════════
   VETSY  –  login.css  (v2 redesign)
   Inspired by clean split-screen mobile-first UX
══════════════════════════════════════════ */

:root {
  --brand:        #0e2a40;
  --brand-mid:    #163d5a;
  --accent:       #2e9496;
  --accent-glow:  rgba(46,148,150,.22);
  --gold:         #d5a370;
  --ink:          #111111;
  --ink-mid:      #444444;
  --ink-soft:     #999999;
  --white:        #ffffff;
  --surface:      #f7f8fa;
  --line:         #e8eaed;

  --radius-sm:    10px;
  --radius:       14px;
  --radius-pill:  9999px;
  --ease:         cubic-bezier(0.16, 1, 0.3, 1);
  --fast:         180ms;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--brand);
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ══ SPLIT SHELL ══ */
.login-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  min-height: 100dvh; /* prevents address-bar bounce on mobile */
}

/* ══ HERO PANEL (LEFT) ══ */
.login-hero {
  position: relative;
  background: linear-gradient(150deg, #0e2a40 0%, #0d3350 55%, #0b2840 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem;
  overflow: hidden;
}

/* Ambient blobs */
.login-hero::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(46,148,150,.2) 0%, transparent 65%);
  top: -120px; right: -140px;
  pointer-events: none;
}
.login-hero::after {
  content: '';
  position: absolute;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(213,163,112,.12) 0%, transparent 65%);
  bottom: 40px; left: -80px;
  pointer-events: none;
}

.hero-back {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-size: .8rem;
  font-weight: 500;
  color: rgba(255,255,255,.45);
  transition: color var(--fast);
  width: fit-content;
  z-index: 1;
}
.hero-back:hover { color: rgba(255,255,255,.85); }
.hero-back svg { width: 14px; height: 14px; }

.hero-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 1;
  padding: 3rem 0 2.5rem;
}

.hero-logo {
  margin-bottom: 3rem;
}
.hero-logo img {
  width: 160px;
  height: auto;
  filter: brightness(0) invert(1);
  opacity: .9;
}

.hero-heading {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.1rem, 3.2vw, 3rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 1.125rem;
}
.hero-heading em {
  font-style: italic;
  color: var(--gold);
}

.hero-sub {
  font-size: .9375rem;
  color: rgba(255,255,255,.55);
  line-height: 1.65;
  max-width: 300px;
  margin-bottom: 2.5rem;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .4rem .9rem;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-pill);
  font-size: .775rem;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  backdrop-filter: blur(10px);
}
.hero-pill svg { width: 12px; height: 12px; color: var(--gold); }

.hero-footer {
  z-index: 1;
  font-size: .72rem;
  color: rgba(255,255,255,.25);
}

/* ══ FLOATING STAT CARDS ══ */
.hero-cards {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-top: 2.5rem;
  z-index: 1;
}

.hero-card {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .875rem 1.125rem;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  transition: background var(--fast), border-color var(--fast);
  max-width: 260px;
}
.hero-card:hover {
  background: rgba(255,255,255,.11);
  border-color: rgba(255,255,255,.18);
}

.hero-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(213,163,112,.18);
  border: 1px solid rgba(213,163,112,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hero-card__icon svg {
  width: 18px;
  height: 18px;
  color: var(--gold);
}

.hero-card__val {
  font-size: .9375rem;
  font-weight: 700;
  color: rgba(255,255,255,.92);
  line-height: 1.2;
}
.hero-card__lbl {
  font-size: .775rem;
  color: rgba(255,255,255,.45);
  margin-top: 1px;
}

/* ══ PAWS DECORATION ══ */
.hero-paws {
  position: absolute;
  bottom: 2.5rem;
  right: 2.5rem;
  opacity: .05;
  z-index: 0;
  pointer-events: none;
}

/* ══ FORM PANEL (RIGHT) ══ */
.login-form-panel {
  background: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem clamp(2rem, 5vw, 4rem);
  overflow-y: auto;
}

.form-panel-inner {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

/* ══ HEADER ══ */
.form-panel-head {
  margin-bottom: 2rem;
}
.form-panel-head h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.035em;
  margin-bottom: .3rem;
}
.form-panel-head p {
  font-size: .875rem;
  color: var(--ink-soft);
}

/* ══ TABS ══ */
.login-tabs {
  display: flex;
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: .25rem;
  margin-bottom: 1.75rem;
  gap: .25rem;
}
.login-tab {
  flex: 1;
  padding: .55rem .75rem;
  border-radius: var(--radius-pill);
  font-size: .875rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-align: center;
  cursor: pointer;
  transition: background var(--fast), color var(--fast), box-shadow var(--fast);
  border: none;
  background: none;
  font-family: inherit;
}
.login-tab.active {
  background: var(--white);
  color: var(--brand);
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  font-weight: 700;
}

/* ══ GOOGLE BUTTON ══ */
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .625rem;
  padding: .8rem 1rem;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: .9375rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: background var(--fast), border-color var(--fast), box-shadow var(--fast);
  min-height: 50px;
}
.btn-google:hover  { background: var(--surface); border-color: #d0d4d8; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.btn-google:active { background: #eff0f2; }
.btn-google:disabled { opacity: .5; cursor: not-allowed; }
.btn-google .spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(0,0,0,.15);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin .65s linear infinite;
  display: none;
}
.btn-google.loading .spinner   { display: block; }
.btn-google.loading .btn-label { display: none; }
.btn-google.loading .g-logo    { display: none; }

/* ══ DIVIDER ══ */
.login-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.25rem 0;
  color: var(--ink-soft);
  font-size: .775rem;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ══ FORM FIELDS ══ */
.form-group { margin-bottom: .875rem; }

.form-label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink-mid);
  margin-bottom: .35rem;
  letter-spacing: .01em;
}

.form-input {
  width: 100%;
  padding: .8rem 1.125rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: .9375rem;
  color: var(--ink);
  background: var(--surface);
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
  outline: none;
}
.form-input:focus {
  border-color: var(--accent);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: #bfc5cc; }
.form-input.error { border-color: #ef4444; }

/* Password wrapper */
.input-wrap { position: relative; }
.input-wrap .form-input { padding-right: 3rem; }
.input-wrap__toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  border: none;
  background: none;
  padding: .25rem;
}
.input-wrap__toggle svg { width: 17px; height: 17px; }
.input-wrap__toggle:hover { color: var(--accent); }

/* ══ FORGOT PASSWORD ══ */
.forgot-link {
  display: block;
  text-align: right;
  font-size: .8rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: -.25rem;
  margin-bottom: .75rem;
  cursor: pointer;
}
.forgot-link:hover { text-decoration: underline; }

/* ══ SUBMIT BUTTON ══ */
.login-submit {
  width: 100%;
  padding: .875rem;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: .5rem;
  letter-spacing: .01em;
  transition: opacity var(--fast), box-shadow var(--fast), transform var(--fast), background var(--fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 52px;
  box-shadow: 0 4px 18px rgba(14,42,64,.28);
}
.login-submit:hover {
  background: var(--brand-mid);
  box-shadow: 0 6px 24px rgba(14,42,64,.38);
  transform: translateY(-1px);
}
.login-submit:active { transform: translateY(0); }
.login-submit:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.login-submit .spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.login-submit.loading .spinner   { display: block; }
.login-submit.loading .btn-label { display: none; }

/* ══ SWITCH LINK (bottom) ══ */
.login-switch {
  margin-top: 1.5rem;
  text-align: center;
  font-size: .875rem;
  color: var(--ink-soft);
}
.login-switch a, .login-switch button {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
}
.login-switch a:hover, .login-switch button:hover { text-decoration: underline; }

/* ══ BANNERS ══ */
.form-banner {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  margin-bottom: 1rem;
  display: none;
}
.form-banner.error   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.form-banner.success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.form-banner.show { display: block; }

/* ══ TERMS TEXT ══ */
.login-terms {
  font-size: .775rem;
  color: var(--ink-soft);
  margin-top: 1rem;
  line-height: 1.5;
  text-align: center;
}
.login-terms a { color: var(--accent); font-weight: 500; }

/* ══ KEYFRAMES ══ */
@keyframes spin { to { transform: rotate(360deg); } }

/* ══ MOBILE ══ */
@media (max-width: 768px) {
  body { background: var(--white); }

  .login-split {
    grid-template-columns: 1fr;
    /* Stack hero + form; form scrolls independently so no whole-page overflow */
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
  }

  .login-hero {
    padding: 1.25rem 1.25rem 2rem;
    min-height: 200px;
    border-radius: 0 0 28px 28px;
    flex-shrink: 0;
  }

  .hero-body { padding: 1rem 0 0; }
  .hero-heading { font-size: 1.65rem; }
  .hero-sub { display: none; }
  .hero-pills { display: none; }
  .hero-cards { display: none; }
  .hero-footer { display: none; }
  .hero-logo { margin-bottom: 1rem; }
  .hero-logo img { width: 110px; }

  .login-form-panel {
    /* Let the form panel be as tall as it needs; page scrolls naturally */
    padding: 1.5rem 1.25rem env(safe-area-inset-bottom, 1.5rem);
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .form-panel-inner { max-width: 100%; }

  /* Tighten vertical rhythm on very small screens */
  .form-panel-head { margin-bottom: 1.25rem; }
  .form-panel-head h1 { font-size: 1.45rem; }
  .login-tabs { margin-bottom: 1.25rem; }
  .form-group { margin-bottom: .75rem; }
}

@media (max-width: 400px) {
  .login-hero { min-height: 180px; padding: 1rem 1.125rem 1.75rem; }
  .hero-heading { font-size: 1.45rem; }
  .login-form-panel { padding: 1.25rem 1rem env(safe-area-inset-bottom, 1.25rem); }
}

/* ══ NATIVE APP MODE ══ */
/* When running inside Capacitor (.app-mode on <html>), hero is hidden entirely
   so the form fills the screen cleanly on small devices */
html.app-mode .login-hero { display: none; }
html.app-mode .login-split { grid-template-columns: 1fr; }
html.app-mode .login-form-panel {
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2.5rem 1.5rem env(safe-area-inset-bottom, 2rem);
}
