/* ==========================================================================
   OrganicMilk Vizag — Sign in / Create account
   Builds on styles.css tokens (colors, fonts, buttons, fields).
   ========================================================================== */

.auth-body { background: var(--cream); }
.auth { min-height: 100dvh; display: grid; }
@media (min-width: 960px) { .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); } }

/* ---------- Art panel (milk + meadow) ---------- */
.auth__art {
  position: relative; overflow: hidden; isolation: isolate; color: #fff;
  display: flex; flex-direction: column;
  padding: 16px var(--gutter) 104px;
  background:
    radial-gradient(70% 45% at 10% 0%, rgba(169, 203, 44, .38), transparent 70%),
    radial-gradient(60% 40% at 100% 10%, rgba(141, 200, 236, .35), transparent 70%),
    linear-gradient(165deg, #2f8a1f 0%, #1a5c12 55%, #0f3a10 100%);
}
@media (min-width: 960px) {
  .auth__art { position: sticky; top: 0; height: 100dvh; padding: 28px 48px 170px; }
}

.auth__back {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 4px;
  min-height: 44px; padding: 0 14px 0 8px; border-radius: 999px;
  color: #fff; text-decoration: none; font-weight: 700; font-size: .9rem;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  transition: background-color var(--dur);
}
.auth__back:hover { background: rgba(255,255,255,.22); }

.auth__hero { position: relative; z-index: 1; margin: auto 0; display: grid; justify-items: center; text-align: center; padding-top: 8px; }
.auth__logo { position: relative; display: block; border-radius: 50%; }
.auth__logo::before { content: ''; position: absolute; inset: -14%; z-index: -1; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.55), rgba(255,255,255,0) 68%); }
.auth__logo img { width: 128px; height: auto; filter: drop-shadow(0 14px 28px rgba(0,0,0,.28)); animation: authFloat 7s ease-in-out infinite; }
.auth__kicker { margin-top: 14px; font-size: .78rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.auth__headline { margin-top: 6px; color: #fff; font-weight: 700; font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3.3rem); line-height: 1.05; text-shadow: 0 2px 18px rgba(0,0,0,.18); }
.auth__perks { display: none; }

@media (min-width: 960px) {
  .auth__logo img { width: 210px; }
  .auth__perks { display: grid; gap: 12px; margin-top: 30px; text-align: left; max-width: 380px; }
  .auth__perks li { display: flex; align-items: center; gap: 14px; font-weight: 600; color: #eaf5e2; }
  .auth__perks span { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); color: var(--gold); }
  .auth__perks .icon { width: 22px; height: 22px; }
}

/* Floating milk drops */
.auth__drops i {
  position: absolute; z-index: 0; display: block;
  width: var(--s, 16px); height: var(--s, 16px);
  background: linear-gradient(135deg, #fff, #f3f0e4);
  border-radius: 0 50% 50% 50%; transform: rotate(45deg);
  opacity: var(--o, .35);
  animation: authDrop var(--t, 9s) ease-in-out infinite; animation-delay: var(--d, 0s);
}
.auth__drops i:nth-child(1) { --s: 22px; --o: .45; left: 12%; top: 22%; --t: 8s; }
.auth__drops i:nth-child(2) { --s: 12px; --o: .3; left: 82%; top: 16%; --t: 10s; --d: -3s; }
.auth__drops i:nth-child(3) { --s: 30px; --o: .22; left: 74%; top: 52%; --t: 12s; --d: -6s; }
.auth__drops i:nth-child(4) { --s: 14px; --o: .38; left: 20%; top: 64%; --t: 9s; --d: -2s; }
.auth__drops i:nth-child(5) { --s: 18px; --o: .28; left: 50%; top: 8%; --t: 11s; --d: -5s; }

/* Milk wave at the bottom of the art panel */
.auth__wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 110px; z-index: 0; }
.auth__wave-b { fill: rgba(255, 255, 255, .32); animation: authWave 7s ease-in-out infinite; transform-origin: center bottom; }
.auth__wave-f { fill: var(--cream); }
@media (min-width: 960px) { .auth__wave { height: 160px; } .auth__wave-f { fill: #fffdf8; } }

@keyframes authFloat { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(-1.5deg); } }
@keyframes authDrop { 0%, 100% { transform: translateY(0) rotate(45deg); } 50% { transform: translateY(-14px) rotate(45deg); } }
@keyframes authWave { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(6px) scaleY(1.08); } }

/* ---------- Form panel ---------- */
.auth__panel {
  position: relative; z-index: 1;
  display: grid; justify-items: center; align-content: start;
  padding: 0 var(--gutter) 32px;
}
.auth__panel::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(28% 22% at 92% 8%, rgba(141, 200, 236, .25), transparent 70%),
    radial-gradient(30% 25% at 5% 95%, rgba(169, 203, 44, .16), transparent 70%);
}
@media (min-width: 960px) { .auth__panel { align-content: center; padding: 48px; } }

.auth__card {
  width: min(100%, 500px); margin-top: -64px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 28px;
  box-shadow: 0 20px 50px rgba(18, 74, 14, .14), 0 2px 6px rgba(18, 74, 14, .06);
  padding: 22px 20px 26px;
}
@media (min-width: 640px) { .auth__card { padding: 30px 36px 34px; } }
@media (min-width: 960px) { .auth__card { margin-top: 0; } }
#registerForm { --gap: 14px; }
.auth__card:has(#registerForm) { width: min(100%, 560px); }

/* Segmented Sign in / Create account switch */
.auth__switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 5px; margin-bottom: 24px; border-radius: 999px; background: var(--cream-2); border: 1px solid var(--line); }
.auth__switch a {
  display: grid; place-items: center; min-height: 44px; border-radius: 999px;
  font-weight: 800; font-size: .95rem; color: var(--muted); text-decoration: none;
  transition: background-color var(--dur), color var(--dur), box-shadow var(--dur);
}
.auth__switch a:hover { color: var(--green-800); }
.auth__switch a[aria-current="page"] { background: var(--surface); color: var(--green-800); box-shadow: 0 2px 8px rgba(18,74,14,.12); }

.auth__head h1 { font-size: clamp(1.7rem, 1.4rem + 1.2vw, 2.15rem); font-weight: 700; }
.auth__head p { margin-top: 4px; color: var(--text-muted); }

.auth__preview {
  display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; padding: 10px 12px;
  border-radius: 12px; background: #e9f4fc; border: 1px solid #cfe5f5; color: #1f5f86; font-size: .85rem; font-weight: 600;
}
.auth__preview .icon { margin-top: 1px; }
.auth__preview[hidden] { display: none; }

.auth__form { display: grid; gap: var(--gap, 16px); margin-top: 22px; }
.auth__form .btn--block { margin-top: 4px; }

/* Inputs with leading icons */
.ifield { position: relative; }
.ifield > .icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--green-600); pointer-events: none; transition: color var(--dur); }
.ifield input { padding-left: 46px; }
.ifield--plain input { padding-left: 14px; }
.otp-inputs { display: flex; justify-content: center; gap: 10px; }
.otp-inputs .otp-input { width: clamp(40px, 11vw, 50px); height: 54px; padding: 0; border: 1px solid var(--border, #d9e3d2); border-radius: 12px; background: var(--surface, #fff); color: var(--green-800); font: 700 1.45rem/1 'Nunito', sans-serif; text-align: center; transition: border-color var(--dur), box-shadow var(--dur); }
.otp-inputs .otp-input:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(35,117,27,.14); }
.ifield:has(.ifield__toggle) input, .ifield:has(.ifield__ok) input { padding-right: 52px; }
.field.is-invalid .ifield > .icon { color: var(--danger); }
.ifield__toggle {
  position: absolute; right: 3px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 10px;
  background: none; color: var(--muted); transition: color var(--dur), background-color var(--dur);
}
.ifield__toggle:hover { color: var(--green-700); background: var(--green-100); }
.ifield__toggle .icon { width: 20px; height: 20px; }
.ifield__ok { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--green-600); color: #fff; }
.ifield__ok[hidden] { display: none; }
.ifield__ok .icon { width: 14px; height: 14px; stroke-width: 3; }

/* Password strength */
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 4px; }
.meter i { height: 6px; border-radius: 99px; background: #e6ebe0; transition: background-color var(--dur); }
.meter[data-score="1"] i:nth-child(-n+1) { background: #d64545; }
.meter[data-score="2"] i:nth-child(-n+2) { background: #e3a008; }
.meter[data-score="3"] i:nth-child(-n+3) { background: var(--gold); }
.meter[data-score="4"] i { background: var(--green-600); }
.auth__hint { font-size: .85rem; color: var(--text-muted); }
.auth__caps { font-size: .85rem; font-weight: 700; color: #8a5a00; }
.auth__caps[hidden] { display: none; }

.auth__group { margin: 0; padding: 0; border: 0; min-width: 0; }
.auth__group legend { padding: 0; margin-bottom: 8px; font-weight: 700; font-size: .925rem; color: var(--green-900); }

/* Custom checkbox */
.check { position: relative; display: inline-flex; align-items: flex-start; gap: 10px; min-height: 44px; padding-top: 10px; cursor: pointer; font-size: .925rem; font-weight: 600; color: var(--ink-2); line-height: 1.45; }
.check input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; top: 10px; left: 0; cursor: pointer; }
.check__box { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid #c5d0bb; background: #fff; transition: background-color var(--dur), border-color var(--dur); }
.check__box .icon { width: 14px; height: 14px; stroke-width: 3; color: #fff; opacity: 0; transition: opacity var(--dur); }
.check input:checked + .check__box { background: var(--green-700); border-color: var(--green-700); }
.check input:checked + .check__box .icon { opacity: 1; }
.check input:focus-visible + .check__box { outline: 3px solid var(--ring); outline-offset: 2px; }
.field.is-invalid .check__box { border-color: var(--danger); }

.auth__row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-top: -4px; }
.auth__row .check { padding-top: 0; align-items: center; }
.auth__row .check input { top: 11px; }
.auth__link { display: inline-flex; align-items: center; min-height: 44px; color: var(--green-700); font-weight: 800; font-size: .925rem; text-decoration: none; }
.auth__link:hover { text-decoration: underline; text-underline-offset: 4px; }
.auth__forgot { padding: 12px 14px; border-radius: 12px; background: var(--green-100); border: 1px solid var(--green-200); font-size: .9rem; color: var(--green-900); }
.auth__forgot[hidden] { display: none; }
.auth__forgot a { color: var(--green-700); font-weight: 700; }
.auth__form#resetRequest input, .auth__form#resetVerify input, .auth__form#resetPassword input { padding-left: 14px; }
.auth__form .auth__link { justify-self: center; border: 0; background: transparent; cursor: pointer; }

.auth__or { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; color: var(--muted); font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.auth__or::before, .auth__or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth__alt { margin-top: 20px; text-align: center; color: var(--text-muted); font-size: .95rem; }
.auth__alt a { color: var(--green-700); font-weight: 800; text-underline-offset: 4px; }
.auth__fine { margin-top: 20px; text-align: center; font-size: .8rem; font-weight: 700; letter-spacing: .04em; color: var(--earth-600); }

/* Success */
.auth__success { display: grid; justify-items: center; gap: 12px; padding: 16px 0 6px; text-align: center; outline: none; }
.auth__success[hidden] { display: none; }
.auth__success .success__icon { margin-bottom: 12px; }
.auth__success h2 { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem); font-weight: 700; }
.auth__success p { color: var(--ink-2); margin-bottom: 8px; }

@media (prefers-reduced-motion: reduce) {
  .auth__logo img, .auth__drops i, .auth__wave-b { animation: none; }
}

/* Installed app (PWA): no "Back to home" link — the app starts at the account pages */
@media (display-mode: standalone) { .auth__back { display: none !important; } }
.is-pwa .auth__back { display: none !important; }

/* Continue with Google */
.google-box { display: grid; justify-items: center; gap: 8px; min-height: 44px; }
.google-box__status { margin: 0; min-height: 1.2em; font-size: .9rem; font-weight: 700; color: var(--green-700, #22701a); text-align: center; }
.google-box__status.is-error { color: var(--danger, #b3261e); }
.google-box__status:empty { display: none; }

/* ===== No sideways scrolling on small phones (decor, waves, Google's iframe) ===== */
html:has(.auth-body), .auth-body { overflow-x: clip; }
.auth__card { max-width: 100%; min-width: 0; }

/* ===== "Continue with Google" — highlighted card ===== */
.g-hero { position: relative; display: grid; justify-items: center; gap: 10px; padding: 22px 18px 18px; border-radius: 20px; text-align: center;
  background: radial-gradient(120% 90% at 50% 0%, #eef6ff 0%, #f6fbf3 60%, #fff 100%); border: 1.5px solid #cfe1fb;
  box-shadow: 0 10px 28px rgba(26, 115, 232, .12), 0 2px 6px rgba(31, 58, 43, .05); overflow: hidden; }
.g-hero::before { content: ''; position: absolute; inset: -40% -20% auto; height: 120px; background: radial-gradient(closest-side, rgba(66, 133, 244, .16), transparent); pointer-events: none; }
.g-hero__badge { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: #1a73e8; color: #fff;
  font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; box-shadow: 0 4px 12px rgba(26, 115, 232, .3); }
.g-hero__badge .icon { width: 14px; height: 14px; }
.g-hero__title { position: relative; margin: 2px 0 0; font-family: 'Fredoka', sans-serif; font-size: 1.35rem; color: var(--green-900); }
.g-hero__sub { position: relative; margin: 0; max-width: 34ch; color: var(--muted); font-size: .92rem; line-height: 1.45; }
.g-hero__btn { position: relative; width: 100%; max-width: 400px; min-height: 44px; display: flex; justify-content: center; }
.g-hero__btn > div { margin-inline: auto; }
.google-native-button { width: 100%; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid #dadce0; border-radius: 999px; background: #fff; color: #3c4043; font: 600 15px Arial, sans-serif; cursor: pointer; }
.google-native-button:active { background: #f7f8f8; }
.google-native-button__icon { width: 20px; height: 20px; flex: 0 0 20px; }
.g-hero--compact { padding: 16px 16px 14px; gap: 8px; }
.g-hero .google-box__status { margin: 0; }

/* ===== Sign-up: choose → steps ===== */
.reg-manual { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 18px;
  background: #fff; color: var(--green-900); text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.reg-manual:hover { border-color: var(--green-600); background: var(--green-100); box-shadow: var(--shadow-sm); }
.reg-manual:focus-visible { outline: 3px solid rgba(47, 138, 31, .45); outline-offset: 2px; }
.reg-manual__icon { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--green-100); color: var(--green-700); }
.reg-manual__text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.reg-manual__text strong { font-size: 1rem; }
.reg-manual__text span { color: var(--muted); font-size: .85rem; }
.reg-manual__go { flex: none; color: var(--green-600); }
.reg-steps { display: grid; gap: 8px; margin-bottom: 4px; }
.reg-steps__label { font-size: .8rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--green-700); }
.reg-steps__bar { height: 6px; border-radius: 999px; background: var(--green-100); overflow: hidden; }
.reg-steps__bar i { display: block; height: 100%; width: 50%; border-radius: inherit; background: linear-gradient(90deg, var(--green-600), #a9cb2c); transition: width .3s ease; }
.reg-step { display: grid; gap: 16px; margin: 0; padding: 0; border: 0; min-width: 0; }
.reg-step[hidden] { display: none; }
.reg-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.reg-back-choose { justify-self: center; padding: 6px 10px; border: 0; background: none; color: var(--green-700); font: inherit; font-weight: 700; cursor: pointer; }
.reg-back-choose:hover { text-decoration: underline; }
@media (max-width: 420px) { .reg-form .form__row--2 { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .reg-steps__bar i { transition: none; } }

.reg-actions > * { min-width: 0; }
@media (max-width: 420px) {
  .reg-actions { grid-template-columns: 1fr; }
  .reg-actions [data-reg-back] { order: 2; }
}

/* Hidden really means hidden (the form and the manual button use display: grid/flex) */
.auth__form[hidden], .reg-manual[hidden], .reg-choose [hidden] { display: none !important; }

/* One Tap held back by Google: make our Google card stand out instead */
.g-hero--nudge { animation: gNudge 2.4s ease-in-out 3; }
@keyframes gNudge { 0%, 100% { box-shadow: 0 10px 28px rgba(26, 115, 232, .12), 0 0 0 0 rgba(26, 115, 232, .0); } 50% { box-shadow: 0 10px 28px rgba(26, 115, 232, .18), 0 0 0 6px rgba(26, 115, 232, .18); } }
@media (prefers-reduced-motion: reduce) { .g-hero--nudge { animation: none; box-shadow: 0 0 0 3px rgba(26, 115, 232, .25); } }

/* ===== Google colours: turning multicolour ring around the (white) Google button + badge ===== */
@property --g-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.g-ring { position: relative; width: 100%; max-width: 406px; padding: 3px; border-radius: 999px;
  background: conic-gradient(from var(--g-angle), #4285f4, #34a853, #fbbc05, #ea4335, #4285f4);
  box-shadow: 0 8px 22px rgba(66, 133, 244, .22), 0 3px 10px rgba(52, 168, 83, .14); animation: gSpin 6s linear infinite; }
.g-ring .g-hero__btn { border-radius: 999px; background: #fff; overflow: hidden; }
@keyframes gSpin { to { --g-angle: 360deg; } }
.g-hero__badge { background: linear-gradient(90deg, #4285f4, #34a853 38%, #fbbc05 68%, #ea4335); box-shadow: 0 4px 12px rgba(66, 133, 244, .28); text-shadow: 0 1px 1px rgba(0, 0, 0, .18); }
.g-hero { border-color: #dfe7f5; background: radial-gradient(120% 90% at 50% 0%, #f2f6ff 0%, #f8fbf4 60%, #fff 100%); }
@media (prefers-reduced-motion: reduce) { .g-ring { animation: none; } }

/* Badge: white chip (Google style) */
.g-hero__badge { background: #fff; color: #3c4043; border: 1px solid #dadce0; text-shadow: none; box-shadow: 0 1px 3px rgba(60, 64, 67, .15); }
.g-hero__badge .icon { color: #34a853; }
