:root {
  --bg: #dddddd;
  --surface: #f7f5f4;
  --card: #fcfbfa;
  --card-line: rgba(20, 20, 20, 0.08);
  --text: #181818;
  --muted: #767676;
  --accent: #ef7a33;
  --accent-dark: #df6821;
  --butter: #edd288;
  --white: #ffffff;
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.07);
  --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.06);
  --radius-stage: 34px;
  --radius-card: 28px;
  --radius-control: 18px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  min-height: 100dvh;
}

a, button, input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  cursor: pointer;
  background: none;
}

.page-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 34px;
}

.auth-stage {
  width: min(1120px, 100%);
  margin-inline: auto;
  min-height: 720px;
  padding: 40px 42px 34px;
  background: var(--surface);
  border-radius: var(--radius-stage);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.stage-topbar,
.stage-content {
  position: relative;
  z-index: 2;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #fff 0 18%, transparent 19%), linear-gradient(145deg, #f4a34d, #ea6f28);
  position: relative;
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 3px solid rgba(255,255,255,0.72);
  border-radius: 50%;
}

.brand-text {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.stage-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.socials {
  display: flex;
  gap: 12px;
}

.social-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1.4px solid rgba(19, 19, 19, 0.24);
  background: rgba(255, 255, 255, 0.82);
  transition: transform .24s ease, box-shadow .24s ease, background .24s ease;
}

.social-btn svg {
  width: 22px;
  height: 22px;
}

.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
}

.social-btn--filled {
  background: #191919;
  color: #fff;
  border-color: #191919;
}

.stage-content {
  min-height: 610px;
  display: grid;
  grid-template-columns: 1fr minmax(370px, 410px) 1fr;
  align-items: end;
  gap: 34px;
  margin-top: 18px;
}

.decor {
  min-height: 480px;
  position: relative;
}

.decor-left,
.decor-right {
  display: flex;
  align-items: end;
  justify-content: center;
  padding-bottom: 38px;
}

.hero-illustration {
  width: min(340px, 100%);
  object-fit: contain;
  filter: drop-shadow(0 12px 26px rgba(0,0,0,0.04));
  animation: floaty 4.5s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.left-sketch--marks,
.left-sketch--marks::before,
.left-sketch--marks::after {
  position: absolute;
  content: "";
  width: 18px;
  border-top: 3px solid #151515;
  border-radius: 999px;
}

.left-sketch--marks {
  left: 96px;
  bottom: 294px;
  transform: rotate(-24deg);
}

.left-sketch--marks::before {
  left: 24px;
  top: -14px;
  transform: rotate(54deg);
}

.left-sketch--marks::after {
  left: 34px;
  top: 8px;
  width: 14px;
  transform: rotate(88deg);
}

.line-ground {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(320px, 88%);
  border-top: 1.6px solid rgba(20,20,20,.55);
  bottom: 26px;
}

.auth-panel-shell {
  align-self: center;
  position: relative;
}

.mode-switch {
  width: 100%;
  height: 54px;
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(20,20,20,0.08);
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 6px;
  margin-bottom: 16px;
  box-shadow: 0 12px 20px rgba(0,0,0,0.04);
}

.mode-switch__pill {
  position: absolute;
  top: 6px;
  left: 6px;
  width: calc(50% - 6px);
  height: calc(100% - 12px);
  border-radius: 999px;
  background: #191919;
  transition: transform .34s ease;
}

.auth-stage.is-signup .mode-switch__pill {
  transform: translateX(100%);
}

.mode-switch__item {
  position: relative;
  z-index: 2;
  font-weight: 700;
  color: var(--muted);
  transition: color .25s ease;
}

.mode-switch__item.is-active {
  color: #fff;
}

.auth-card {
  background: var(--card);
  border-radius: var(--radius-card);
  border: 1px solid var(--card-line);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.auth-slider {
  width: 200%;
  display: flex;
  transform: translateX(0);
  transition: transform .42s cubic-bezier(.22,.61,.36,1);
}

.auth-stage.is-signup .auth-slider {
  transform: translateX(-50%);
}

.auth-view {
  width: 50%;
  flex: 0 0 50%;
  padding: 30px 30px 26px;
}

.auth-copy h1 {
  margin: 0;
  font-size: clamp(2.3rem, 4vw, 3rem);
  line-height: .96;
  letter-spacing: -.055em;
}

.auth-copy p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 28px;
}

.input-field {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 58px;
  padding: 0 18px;
  border-radius: var(--radius-control);
  background: #f5f3f2;
  border: 1px solid rgba(20,20,20,.08);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.input-field:focus-within {
  border-color: rgba(239, 122, 51, 0.5);
  box-shadow: 0 0 0 4px rgba(239, 122, 51, 0.1);
  background: #fff;
}

.input-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #262626;
  flex-shrink: 0;
}

.input-icon svg,
.google-icon svg {
  width: 100%;
  height: 100%;
}

.input-field input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 1rem;
  color: var(--text);
}

.input-field input::placeholder {
  color: #8f8f8f;
}

.primary-btn,
.secondary-btn {
  height: 56px;
  border-radius: 18px;
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}

.primary-btn:hover,
.secondary-btn:hover {
  transform: translateY(-2px);
}

.primary-btn {
  margin-top: 8px;
  color: #fff;
  font-size: 1.12rem;
  font-weight: 800;
  background: linear-gradient(180deg, #f1873d, #ea732a);
  box-shadow: 0 16px 30px rgba(239, 122, 51, 0.22);
}

.secondary-btn {
  background: #fff;
  border: 1px solid rgba(20,20,20,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #2b2b2b;
  font-weight: 600;
}

.google-icon {
  width: 22px;
  height: 22px;
}

.bottom-text {
  margin: 18px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: .92rem;
}

.text-switch {
  color: #2d2d2d;
  font-weight: 700;
}

.bar-group {
  display: flex;
  align-items: end;
}

.bar {
  display: block;
  border: 1.6px solid rgba(20,20,20,.72);
  border-bottom: 0;
}

.bar--light {
  width: 92px;
  height: 126px;
  background: rgba(255,255,255,.25);
}

.bar--accent {
  width: 92px;
  height: 186px;
  background: var(--butter);
  margin-left: -1px;
}

.cloud-shape,
.cloud-shape::before,
.cloud-shape::after {
  position: absolute;
}

.cloud-shape {
  width: 120px;
  height: 78px;
  right: 52px;
  bottom: 156px;
}

.cloud-shape::before,
.cloud-shape::after {
  content: "";
  border: 1.6px solid rgba(20,20,20,.78);
  border-bottom: 0;
}

.cloud-shape::before {
  width: 64px;
  height: 34px;
  left: 0;
  bottom: 0;
  border-radius: 999px 999px 0 0;
}

.cloud-shape::after {
  width: 58px;
  height: 56px;
  right: 0;
  bottom: 0;
  border-radius: 999px 999px 0 0;
}

.auth-stage::before,
.auth-stage::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.auth-stage::before {
  width: 340px;
  height: 340px;
  right: -100px;
  top: -100px;
  background: radial-gradient(circle, rgba(239,122,51,.08), transparent 70%);
}

.auth-stage::after {
  width: 300px;
  height: 300px;
  left: -110px;
  bottom: -120px;
  background: radial-gradient(circle, rgba(237,210,136,.25), transparent 70%);
}

@media (max-width: 980px) {
  .auth-stage {
    padding: 28px 26px 24px;
    min-height: auto;
  }

  .stage-content {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: auto;
    gap: 18px;
  }

  .decor-left,
  .decor-right {
    display: none;
  }

  .auth-panel-shell {
    width: min(420px, 100%);
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 14px;
  }

  .auth-stage {
    border-radius: 26px;
    padding: 18px 16px 18px;
  }

  .stage-topbar {
    gap: 12px;
  }

  .brand-text {
    font-size: 1.58rem;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .social-btn {
    width: 46px;
    height: 46px;
  }

  .auth-view {
    padding: 24px 18px 22px;
  }

  .mode-switch {
    height: 50px;
  }

  .auth-copy h1 {
    font-size: 2rem;
  }

  .input-field,
  .primary-btn,
  .secondary-btn {
    height: 54px;
  }
}


@media (max-width: 560px) {
  .page-shell {
    display: block;
    min-height: auto;
    padding: 16px 10px 24px;
  }

  .auth-stage {
    width: 100%;
    min-height: auto;
    margin: 0 auto;
    padding: 16px 14px 16px;
  }

  .auth-panel-shell {
    width: 100%;
    max-width: 100%;
  }

  .auth-view {
    padding: 22px 16px 20px;
  }

  .auth-copy h1 {
    font-size: clamp(2rem, 10vw, 2.6rem);
    line-height: 0.94;
  }

  .bottom-text {
    font-size: 0.88rem;
  }
}

@media (min-width: 401px) and (max-width: 520px) {
  .auth-stage {
    max-width: 430px;
  }

  .auth-panel-shell {
    max-width: 388px;
    margin: 0 auto;
  }
}

@media (max-width: 450px) {
  .page-shell {
    padding: 14px 10px 20px;
  }

  .auth-stage {
    border-radius: 24px;
  }

  .stage-topbar {
    margin-bottom: 6px;
  }

  .brand {
    gap: 10px;
  }

  .brand-text {
    font-size: 1.4rem;
  }

  .socials {
    gap: 10px;
  }

  .social-btn {
    width: 44px;
    height: 44px;
  }

  .mode-switch {
    height: 48px;
    margin-bottom: 14px;
  }

  .mode-switch__item {
    font-size: 0.96rem;
  }

  .auth-card {
    border-radius: 24px;
  }

  .auth-copy p {
    margin-top: 12px;
    font-size: 0.98rem;
  }

  .auth-form {
    margin-top: 22px;
    gap: 12px;
  }

  .input-field,
  .primary-btn,
  .secondary-btn {
    height: 52px;
    border-radius: 16px;
  }
}

@media (max-width: 380px) {
  .page-shell {
    padding-inline: 8px;
  }

  .auth-stage {
    padding-inline: 12px;
  }

  .auth-view {
    padding-inline: 14px;
  }

  .auth-copy h1 {
    font-size: 1.85rem;
  }

  .input-field input {
    font-size: 0.96rem;
  }
}

/* ===== MOBILE FIX: 380PX TO 600PX ===== */
@media (min-width: 380px) and (max-width: 600px) {
  .page-shell {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 18px 14px 24px;
  }

  .auth-stage {
    width: 100%;
    max-width: 420px;
    min-height: auto;
    padding: 20px 18px 18px;
    border-radius: 24px;
  }

  .stage-content {
    grid-template-columns: 1fr;
    gap: 16px;
    min-height: auto;
    margin-top: 14px;
  }

  .decor-left,
  .decor-right {
    display: none;
  }

  .auth-panel-shell {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
  }

  .stage-topbar {
    gap: 10px;
    margin-bottom: 8px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-text {
    font-size: 1.5rem;
  }

  .socials {
    gap: 10px;
  }

  .social-btn {
    width: 44px;
    height: 44px;
  }

  .mode-switch {
    height: 50px;
    margin-bottom: 14px;
  }

  .mode-switch__item {
    font-size: 0.95rem;
  }

  .auth-card {
    border-radius: 24px;
  }

  .auth-view {
    padding: 24px 18px 22px;
  }

  .auth-copy h1 {
    font-size: clamp(1.95rem, 7vw, 2.45rem);
    line-height: 0.96;
  }

  .auth-copy p {
    font-size: 0.96rem;
    margin-top: 10px;
  }

  .auth-form {
    margin-top: 22px;
    gap: 12px;
  }

  .input-field,
  .primary-btn,
  .secondary-btn {
    height: 52px;
    border-radius: 16px;
  }

  .input-field {
    padding: 0 16px;
  }

  .input-field input {
    font-size: 0.96rem;
    min-width: 0;
  }

  .bottom-text {
    font-size: 0.88rem;
    line-height: 1.45;
    margin-top: 16px;
  }
}

/* ===== EXTRA SMALL MOBILE SAFETY ===== */
@media (max-width: 379px) {
  .page-shell {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 12px 8px 20px;
  }

  .auth-stage {
    width: 100%;
    min-height: auto;
    padding: 14px 12px 14px;
  }

  .auth-panel-shell {
    width: 100%;
    max-width: 100%;
  }

  .decor-left,
  .decor-right {
    display: none;
  }

  .auth-view {
    padding: 20px 14px 18px;
  }

  .auth-copy h1 {
    font-size: 1.8rem;
  }
}
