/* Mealnir — sign in / create account */

.auth__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 100vh; min-height: var(--vh, 100dvh); }

.auth__main { display: flex; flex-direction: column; padding: 20px clamp(16px, 4vw, 56px); }
.auth__top { display: flex; justify-content: space-between; align-items: center; height: 56px; }
.auth__logo { height: 32px; width: auto; }
.auth__back { display: inline-flex; align-items: center; gap: 0.4rem; text-decoration: none; font-weight: 600; font-size: 0.95rem; padding: 0.5rem 0.8rem; border-radius: 999px; }
.auth__back:hover { background: rgba(30, 74, 57, 0.08); }
.auth__back .icon { width: 18px; height: 18px; }

.auth__body { flex: 1; display: grid; place-items: center; padding: clamp(0.75rem, 2.5vh, 2.5rem) 0; }
.auth__panel, .auth__done { width: 100%; max-width: 420px; }

.mode {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr;
  padding: 5px; border-radius: 999px;
  background: var(--paper);
  margin-bottom: 1.5rem;
}
.mode button {
  position: relative; z-index: 1;
  min-height: 44px; border: 0; background: transparent; border-radius: 999px;
  font-weight: 600; font-size: 0.975rem; color: var(--muted);
  transition: color 0.3s;
}
.mode button[aria-selected="true"] { color: var(--ink); }
.mode__thumb {
  position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px);
  background: var(--white); border-radius: 999px; box-shadow: var(--shadow-soft);
  transition: transform 0.45s var(--ease-out);
}
.mode[data-mode="signin"] .mode__thumb { transform: translateX(100%); }

.auth__title { font-size: clamp(2rem, 1.7rem + 1.2vw, 2.6rem); letter-spacing: -0.04em; line-height: 1.02; }
.auth__lede { margin-top: 0.75rem; color: var(--muted); font-size: 1.0625rem; }
.auth__plan {
  margin-top: 1.25rem; display: flex; gap: 0.6rem; align-items: flex-start;
  padding: 0.75rem 0.9rem; border-radius: 14px; background: rgba(30, 74, 57, 0.08); color: var(--green);
  font-size: 0.925rem; font-weight: 500;
}
.auth__plan[hidden] { display: none; }
.auth__plan .icon { width: 18px; height: 18px; margin-top: 2px; stroke-width: 2.2; }

.social { display: grid; gap: 0.6rem; margin-top: 1.5rem; }
.social__btn {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 0.65rem;
  min-height: 50px; padding: 0 1rem; border-radius: 14px;
  font-weight: 600; font-size: 1rem;
  border: 1.5px solid transparent;
  transition: transform 0.2s var(--ease-out), box-shadow 0.25s, background-color 0.25s, border-color 0.25s;
}
.social__btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.social__btn:active { transform: translateY(1px); }
.social__btn--apple { background: var(--ink); color: var(--white); }
.social__btn--google { background: var(--white); color: var(--ink); border-color: var(--line-strong); }
.social__btn--google:hover { border-color: var(--ink); }
.social__logo { width: 20px; height: 20px; }
.social__btn[aria-busy="true"] { pointer-events: none; opacity: 0.85; }
.social__btn[aria-busy="true"] .social__logo { animation: pulse 0.9s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: 0.35; } }

.divider { display: flex; align-items: center; gap: 1rem; margin: 1.1rem 0; color: var(--muted); font-size: 0.875rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }

.form { display: grid; gap: 0.9rem; }
.field { display: grid; gap: 0.45rem; }
.field--name { overflow: hidden; }
.field--name[hidden] { display: none; }
.field label { font-weight: 600; font-size: 0.925rem; }
.field__row { display: flex; justify-content: space-between; align-items: baseline; }
.field__link { font-size: 0.875rem; font-weight: 600; color: var(--green); }
.field__link[hidden] { display: none; }
.field input {
  width: 100%; min-height: 50px;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  border: 1.5px solid var(--line-strong);
  background: var(--white);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder { color: #6A7065; }
.field input:hover { border-color: rgba(27, 33, 27, 0.4); }
.field input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(30, 74, 57, 0.14); }
.field input[aria-invalid="true"] { border-color: #B3401E; box-shadow: 0 0 0 4px rgba(179, 64, 30, 0.12); }
.field__pw { position: relative; }
.field__pw input { padding-right: 3.5rem; }
.field__eye {
  position: absolute; right: 4px; top: 50%; translate: 0 -50%;
  width: 44px; height: 44px; border: 0; background: transparent; border-radius: 10px;
  display: grid; place-items: center; color: var(--muted);
}
.field__eye:hover { color: var(--ink); background: rgba(30, 74, 57, 0.06); }
.field__hint { font-size: 0.85rem; color: var(--muted); }
.field__hint[hidden] { display: none; }
.field__error { display: flex; align-items: center; gap: 0.4rem; font-size: 0.875rem; font-weight: 500; color: #A0391B; }
.field__error[hidden] { display: none; }
.field__error .icon { width: 17px; height: 17px; }

.form__submit { width: 100%; margin-top: 0.4rem; position: relative; }
.spinner {
  display: none;
  width: 20px; height: 20px; border-radius: 99px;
  border: 2.5px solid rgba(27, 33, 27, 0.25); border-top-color: var(--ink);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.form__submit[aria-busy="true"] { pointer-events: none; }
.form__submit[aria-busy="true"] .spinner { display: block; }
.form__submit[aria-busy="true"] .icon--arrow { display: none; }
.form__fine { font-size: 0.85rem; color: var(--muted); text-align: center; }
.form__fine[hidden] { display: none; }
.form__fine a { color: var(--ink); }

.auth__switch { margin-top: 1.75rem; text-align: center; color: var(--muted); font-size: 0.95rem; }
.link-btn { border: 0; background: none; padding: 0.25rem 0.1rem; color: var(--ink); font-size: inherit; }

.auth__done[hidden] { display: none; }
.auth__done { text-align: left; }
.auth__done:focus { outline: none; }
.done__icon { display: none; }
.done__actions { display: grid; gap: 0.6rem; margin-top: 2rem; }

.auth__foot { font-size: 0.85rem; color: var(--muted); padding-top: 1rem; }

/* Aside */
.auth__aside {
  position: sticky; top: 12px;
  margin: 12px 12px 12px 0; height: calc(var(--vh, 100dvh) - 24px);
  border-radius: 32px; overflow: hidden;
  background: var(--green);
  display: grid; grid-template-rows: 1fr auto;
}
.aside__photo { position: absolute; inset: 0; }
.aside__photo img { width: 100%; height: 100%; object-fit: cover; }
.aside__photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(23, 60, 46, 0.88) 0%, rgba(23, 60, 46, 0.35) 34%, rgba(23, 60, 46, 0) 50%, rgba(23, 60, 46, 0) 60%, rgba(23, 60, 46, 0.55) 100%); }
.aside__copy { position: relative; z-index: 1; padding: clamp(2rem, 4vw, 3.5rem); color: var(--cream); }
.aside__title { font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem, 1.2rem + 2.2vw, 3.25rem); letter-spacing: -0.04em; line-height: 1; max-width: 14ch; text-wrap: balance; }
.aside__pad { position: absolute; z-index: 2; left: clamp(1.5rem, 4vw, 3.5rem); bottom: clamp(1.5rem, 4vw, 3.5rem); width: min(340px, 70%); rotate: -2deg; }
.aside__pad .pad { padding: 24px 20px 12px; --pad-line: 52px; --pad-top: 78px; }
.aside__day { height: 52px; gap: 0.75rem; }
.aside__day img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; }
.aside__d { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); width: 2.4rem; }
.aside__chip {
  position: absolute; z-index: 3; right: clamp(1.5rem, 4vw, 3rem); bottom: clamp(9rem, 22vh, 14rem);
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.05rem 0.7rem 0.85rem; border-radius: 999px;
  background: var(--orange); color: var(--ink); font-weight: 600; font-size: 0.95rem;
  box-shadow: var(--shadow-lift);
}

@media (max-width: 960px) {
  .auth__grid { grid-template-columns: 1fr; }
  .auth__aside { display: none; }
  .auth__body { place-items: start center; }
}

.done__list { margin-bottom: 1.25rem; display: inline-block; padding: 0 1rem; border-radius: 14px; background: var(--white); box-shadow: var(--shadow-soft); }
.done__list .list__row { gap: 0.6rem; }

.social[hidden], .divider[hidden], .field[hidden] { display: none; }
.field__suggest { color: var(--green); }
.field__suggest .link-btn { font-weight: 600; padding: 0.1rem 0; min-height: 0; }
.field__opt { font-weight: 400; color: var(--muted); }

.field__eye .eye-off { display: none; }
.field__eye.is-showing .eye-on { display: none; }
.field__eye.is-showing .eye-off { display: block; }
