/* ============================================================
   Sylva — Auth Pages
   Organic blob · Sylva palette · Mobile-first
   ============================================================ */

:root {
  --white:        #ffffff;
  --cream:        #fafaf8;
  --gray-50:      #f7f7f5;
  --gray-100:     #efefec;
  --gray-200:     #e0e0db;
  --gray-400:     #a8a89e;
  --gray-500:     #7a7a70;
  --gray-700:     #3d3d35;
  --gray-900:     #1a1a14;
  --sage:         #2f5132;
  --sage-deep:    #2f5132;
  --sage-mid:     #4a7c54;
  --sage-light:   #8aaf8f;
  --sage-ghost:   #edf3ee;
  --sage-border:  rgba(47,81,50,0.18);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Outfit', system-ui, sans-serif;
  --r-sm: 6px; --r-md: 12px; --r-lg: 18px; --r-xl: 24px; --r-full: 9999px;
  --ease: cubic-bezier(0.4,0,0.2,1);
  --err: #c0392b; --err-bg: rgba(192,57,43,0.08);
  --ok: #1b5e20;  --ok-bg:  rgba(27,94,32,0.08);
  --warn: #7a5a00; --warn-bg: rgba(122,90,0,0.08);
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}
html{font-size:16px;-webkit-text-size-adjust:100%;scroll-behavior:smooth;}

body {
  font-family: var(--font-body);
  background: var(--white);
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  -webkit-font-smoothing: antialiased;
  animation: authIn 0.5s cubic-bezier(0.16,1,0.3,1) both;
}

/* ── WRAPPER ─────────────────────────────── */
.auth-wrap {
  display: flex;
  width: 100%;
  background: var(--sage-deep);
  max-width: 1020px;
  min-height: 600px;
  border-radius: var(--r-xl);
  overflow: hidden;
  position: relative;
  box-shadow: 0 32px 80px rgba(0,0,0,0.22), 0 8px 24px rgba(0,0,0,0.12);
}

/* ── LEFT: PHOTO ─────────────────────────── */
.auth-left {
  flex: 1.1;
  position: relative;
  overflow: hidden;
  min-height: 420px;
  background: var(--sage-deep);
  clip-path: polygon(
    0 0, 88% 0, 100% 8%, 96% 25%,
    100% 42%, 94% 58%, 100% 74%,
    96% 90%, 88% 100%, 0 100%
  );
}

.auth-left__bg {
  position: absolute;
  inset: 0;
  background-image: url('/static/img/auth/hero_login.jpg');
  background-size: cover;
  background-position: center 40%;
  z-index: 0;
}


.auth-left__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 2.5rem 3rem 2.5rem 2.5rem;
}

/* Brand */
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  margin-bottom: auto;
}
.auth-brand__logo {
  width: 38px; height: 38px;
  background: var(--white);
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
}
.auth-brand__logo img { width: 24px; height: auto; }
.auth-brand__name {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.01em;
}
.auth-brand__by {
  font-size: 0.5625rem;
  color: white;
  letter-spacing: 0.06em;
  display: block;
  font-weight: 800;
  margin-top: 1px;
}

.auth-left__text { margin-top: auto; }

.auth-left__title {
  font-family: var(--font-display);
  font-size: clamp(2rem,4vw,3.25rem);
  font-weight: 600;
  line-height: 0.97;
  letter-spacing: -0.035em;
  color: white;
  margin-bottom: 0.875rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.auth-left__title em { font-style: italic; color: white; }

.auth-left__pills { display: flex; flex-direction: column; gap: 0.4rem; }
.auth-left__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: white;
  font-weight: 300;
}
.auth-left__pill::before {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: white;
  flex-shrink: 0;
}

/* ── RIGHT: FORM ─────────────────────────── */
.auth-right {
  flex: 1;
  background: var(--sage-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2.5rem 2.5rem 1.5rem;
  overflow-y: auto;
  position: relative;
}
.auth-right::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.auth-form-box { width: 100%; max-width: 340px; position: relative; z-index: 1; }

.auth-eyebrow {
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage-light);
  margin-bottom: 0.5rem;
  display: block;
}
.auth-title {
  font-family: var(--font-display);
  font-size: clamp(1.625rem,3vw,2.125rem);
  font-weight: 600;
  color: white;
  margin-bottom: 0.375rem;
  letter-spacing: -0.025em;
  line-height: 1.08;
}
.auth-title em { font-style: italic; color: rgba(255,255,255,0.45); }
.auth-desc {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.35);
  margin-bottom: 1.875rem;
  line-height: 1.55;
  font-weight: 300;
}

/* ── FIELDS ──────────────────────────────── */
.field { margin-bottom: 0.875rem; }
.field__label {
  display: block;
  font-size: 0.625rem;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.375rem;
}
.field__input {
  width: 100%;
  padding: 0.75rem 0.9375rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-md);
  font-size: 0.875rem;
  font-family: var(--font-body);
  color: white;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  outline: none;
  -webkit-appearance: none;
}
.field__input::placeholder { color: rgba(255,255,255,0.22); }
.field__input:hover  { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.18); }
.field__input:focus  { background: rgba(255,255,255,0.12); border-color: var(--sage-light); box-shadow: 0 0 0 3px rgba(138,175,143,0.15); }
@media (max-width:480px){ .field__input{ font-size:16px; } }

.field--pw { position: relative; display: flex; align-items: center; }
.field--pw .field__input { padding-right: 3rem; }
.eye-btn {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none;
  color: rgba(255,255,255,0.3); cursor: pointer;
  border-radius: var(--r-sm); transition: color 0.15s; padding: 0;
}
.eye-btn:hover { color: rgba(255,255,255,0.7); }
.eye-btn.hidden { display: none; }

.field__foot { display: flex; justify-content: flex-end; margin-top: 0.35rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem; }

/* ── BUTTONS ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.8125rem 1.5rem;
  border-radius: var(--r-md);
  font-size: 0.9375rem; font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer; text-decoration: none;
  transition: all 0.18s var(--ease);
  border: none; white-space: nowrap; width: 100%;
  letter-spacing: -0.005em;
}
.btn-primary {
  background: var(--sage-mid); color: white;
  box-shadow: 0 4px 20px rgba(74,124,84,0.35);
  margin-top: 0.375rem;
}
.btn-primary:hover { background: var(--sage); transform: translateY(-1px); box-shadow: 0 7px 24px rgba(47,81,50,0.45); }
.btn-primary:active { transform: translateY(0); }

.btn-google {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.75);
  border: 1px solid rgba(255,255,255,0.12);
  font-weight: 400; font-size: 0.875rem;
}
.btn-google:hover { background: rgba(255,255,255,0.11); border-color: rgba(255,255,255,0.2); color: white; }

/* ── DIVIDER ─────────────────────────────── */
.or-divider {
  display: flex; align-items: center;
  margin: 1.125rem 0;
  color: rgba(255,255,255,0.2);
  font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase;
}
.or-divider::before,.or-divider::after { content:''; flex:1; height:1px; background: rgba(255,255,255,0.08); }
.or-divider span { padding: 0 0.75rem; }

/* ── LINKS ───────────────────────────────── */
.auth-switch { text-align: center; margin-top: 1.25rem; font-size: 0.8125rem; color: rgba(255,255,255,0.3); }
.link-sage { color: var(--sage-light); text-decoration: none; font-weight: 500; transition: color 0.15s; }
.link-sage:hover { color: white; }
.link-muted { color: rgba(255,255,255,0.28); font-size: 0.75rem; text-decoration: none; transition: color 0.15s; }
.link-muted:hover { color: rgba(255,255,255,0.55); }

/* ── CONSENT ─────────────────────────────── */
.consent-stack { display: flex; flex-direction: column; gap: 0.625rem; margin: 0.875rem 0 1rem; }
.consent-row {
  display: flex; gap: 0.5rem; align-items: flex-start;
  font-size: 0.75rem; line-height: 1.55;
  color: rgba(255,255,255,0.35); font-weight: 300;
}
.consent-row input[type="checkbox"] { width:14px; height:14px; min-width:14px; accent-color: var(--sage-light); margin-top:0.2rem; cursor:pointer; }
.consent-row a { color: var(--sage-light); text-decoration: none; font-weight: 400; }
.consent-row a:hover { color: white; }

/* ── EMAIL CALLOUT ───────────────────────── */
.email-callout {
  display: flex; gap: 0.5rem; align-items: flex-start;
  margin-top: 0.875rem; padding: 0.75rem 0.875rem;
  border-radius: var(--r-sm);
  background: rgba(138,175,143,0.08);
  border: 1px solid rgba(138,175,143,0.18);
  color: rgba(255,255,255,0.4); font-size: 0.6875rem; line-height: 1.55; font-weight: 300;
}
.email-callout svg { flex-shrink:0; color: var(--sage-light); margin-top:1px; }
.email-callout strong { color: rgba(255,255,255,0.6); font-weight: 500; }
.email-callout a { color: var(--sage-light); }

/* ── FLASH ───────────────────────────────── */
.flash-stack { margin-top: 0.875rem; }
.alert { padding: 0.6875rem 0.875rem; border-radius: var(--r-sm); font-size: 0.75rem; line-height: 1.45; margin-bottom: 0.4rem; opacity: 0; transform: translateY(5px); transition: opacity 0.22s, transform 0.22s; }
.alert.show { opacity:1; transform:translateY(0); }
.alert-success { background: var(--ok-bg);   color: #6fcf97; border: 1px solid rgba(111,207,151,0.2); }
.alert-error   { background: var(--err-bg);  color: #eb5757; border: 1px solid rgba(235,87,87,0.2); }
.alert-warning { background: var(--warn-bg); color: #f2c94c; border: 1px solid rgba(242,201,76,0.2); }

/* ── ANIMATIONS ──────────────────────────── */
@keyframes authIn { from { opacity:0; transform:scale(0.97) translateY(12px); } to { opacity:1; transform:scale(1) translateY(0); } }
@keyframes authOut { to { opacity:0; transform:scale(0.97); } }
body.leaving { animation: authOut 0.28s ease-out forwards; }

/* ── MOBILE ──────────────────────────────── */
@media (max-width: 860px) {
  body { padding:0; background: var(--sage-deep); align-items: flex-start; }
  .auth-wrap { flex-direction: column; border-radius: 0; min-height: 100svh; box-shadow: none; }
  .auth-left { flex: none; min-height: 240px; clip-path: polygon(0 0,100% 0,100% 80%,8% 100%,0 88%); }
  .auth-left__bg::after {
    background: linear-gradient(to bottom, rgba(13,26,15,0.2) 0%, transparent 35%, rgba(30,52,34,0.92) 80%, rgba(30,52,34,1.0) 100%);
  }
  .auth-left__inner { padding: 1.75rem 1.75rem 3rem; flex-direction: row; align-items: flex-end; flex-wrap: wrap; gap: 1rem; }
  .auth-brand { margin-bottom: 0; }
  .auth-left__text { flex:1; min-width:200px; margin-top:0; }
  .auth-left__title { font-size: clamp(1.625rem,6vw,2.25rem); }
  .auth-left__pills { display: none; }
  .auth-right { flex:1; padding: 2.25rem 1.5rem 2.5rem; align-items: flex-start; }
  .auth-form-box { max-width: 100%; }
}
@media (max-width: 480px) {
  .auth-left { min-height: 200px; }
  .auth-left__inner { padding: 1.25rem 1.25rem 2.5rem; }
  .auth-left__title { font-size: 1.5rem; }
  .auth-right { padding: 1.875rem 1.25rem 2rem; }
  .auth-title { font-size: 1.5rem; }
  .field-row { grid-template-columns: 1fr; }
}
@media (max-width: 360px) {
  .auth-left { min-height: 170px; }
  .auth-right { padding: 1.5rem 1rem 1.75rem; }
}