/* Sign-in, registration and the team's sign-in: one card, the form on the left, a picture on the
   right. The picture already carries the curved white edge, so it meets the form without a seam. */

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px;
  background: radial-gradient(900px 500px at 8% 0%, rgba(45, 212, 191, 0.22), transparent 60%),
              radial-gradient(800px 520px at 100% 100%, rgba(20, 184, 166, 0.18), transparent 60%), #f3fbf9; }
.auth-shell[hidden] { display: none; }

.auth-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: min(1160px, 100%); min-height: 660px; overflow: hidden;
  background: #fff; border: 1px solid rgba(255, 255, 255, 0.8); border-radius: 32px; box-shadow: 0 30px 80px rgba(13, 148, 136, 0.18), 0 2px 6px rgba(15, 23, 42, 0.05); }
.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 48px 64px; }
.auth-art { position: relative; background: #d9f7f1; }
.auth-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 78% 25%; }

/* The cards inside the form side have no frame of their own */
.auth-form .login-card { width: 100%; max-width: 430px; margin: 0 auto; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; text-align: left; }
.auth-form .login-card[hidden] { display: none; }

.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth-brand img { width: 46px; height: 46px; border-radius: 13px; object-fit: cover; box-shadow: 0 6px 16px rgba(13, 148, 136, 0.28); }
.auth-brand b { display: block; font-size: 1.12rem; letter-spacing: -0.02em; }
.auth-brand small { display: block; font-size: 0.74rem; font-weight: 500; color: var(--text-muted); }

.auth-title { margin: 0 0 8px; font-size: clamp(2rem, 3.6vw, 2.7rem); line-height: 1.08; letter-spacing: -0.035em; font-weight: 800; }
.auth-title span { background: var(--primary-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.auth-form .subtitle { margin: 0 0 18px; font-size: 1rem; color: var(--text-secondary); }

.auth-form .field { margin-bottom: 14px; }
.auth-form input { padding: 14px 16px; border-radius: 14px; border-color: var(--border-subtle); background: #fff; font-size: 0.95rem; box-shadow: var(--shadow-xs); }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.input-icon input { padding-left: 46px; padding-right: 46px; }
.input-icon .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; min-height: 0; border-radius: 10px; background: transparent; color: var(--text-muted); }
.input-icon .eye:hover { color: var(--primary); background: var(--bg-surface-elevated); }

.auth-submit { min-height: 52px; margin-top: 6px; border-radius: 14px; font-size: 1rem; box-shadow: 0 8px 20px rgba(13, 148, 136, 0.28); }
.auth-submit svg { transition: transform .15s ease; }
.auth-submit:hover svg { transform: translateX(3px); }
.auth-form .error-msg { margin-top: 12px; text-align: left; }
/* "Become a distributor" under the log-in button */
.auth-or { margin-top: 16px; }
.auth-or > span { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.auth-or > span::before, .auth-or > span::after { content: ""; flex: 1; height: 1px; background: var(--border-subtle); }
.auth-cta { width: 100%; min-height: 52px; gap: 10px; border-radius: 14px; border: 1.5px solid var(--primary-border); background: var(--primary-subtle);
  color: var(--primary-hover); font-size: 0.98rem; font-weight: 700; }
.auth-cta:hover { background: #fff; border-color: var(--primary); box-shadow: 0 8px 20px rgba(13, 148, 136, 0.16); transform: translateY(-1px); }
.auth-cta .go { margin-left: auto; transition: transform .15s ease; }
.auth-cta:hover .go { transform: translateX(3px); }
.auth-switch { margin-top: 14px; font-size: 0.88rem; color: var(--text-muted); text-align: left; }
.auth-form .row { margin-bottom: 14px; }

/* Phone: country code list beside the number */
.phone-field { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px; }
.phone-field select { padding: 14px 8px 14px 12px; border-radius: 14px; border: 1px solid var(--border-subtle); background: #fff; font: inherit; font-size: 0.95rem; box-shadow: var(--shadow-xs); }
.phone-field select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-subtle); }
@media (max-width: 960px) { .phone-field select { padding-top: 12px; padding-bottom: 12px; border-radius: 12px; } }

/* Registration steps */
.su-progress { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 4px 0 8px; }
.su-progress span { height: 4px; border-radius: 4px; background: var(--border-subtle); transition: background .2s ease; }
.su-progress span.on { background: var(--primary); }
.su-step-label { margin-bottom: 16px; font-size: 0.8rem; font-weight: 700; color: var(--text-muted); }
.su-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.auth-back { min-height: 52px; padding: 0 22px; border-radius: 14px; }
[id^="suStep"][hidden] { display: none; }

/* On a computer the whole page fits the screen: no scrolling. Phones may scroll. */
@media (min-width: 961px) {
  .auth-shell { height: 100vh; min-height: 0; padding: 24px; overflow: hidden; }
  .auth-card { height: min(760px, calc(100vh - 48px)); min-height: 0; }
  .auth-form { overflow-y: auto; padding-top: 28px; padding-bottom: 28px; }
}
@media (min-width: 961px) and (max-height: 780px) {
  .auth-form { padding: 20px 56px; }
  .auth-brand { margin-bottom: 20px; }
  .auth-brand img { width: 40px; height: 40px; }
  .auth-title { font-size: 2.1rem; }
  .auth-form .subtitle { margin-bottom: 16px; }
  .auth-form .field { margin-bottom: 10px; }
  .auth-form input { padding-top: 12px; padding-bottom: 12px; }
}

@media (max-width: 960px) {
  /* Phones and tablets: a compact card on the soft background, the picture as a short banner on top */
  .auth-shell { min-height: 100dvh; padding: 14px; place-items: start center; }
  .auth-card { grid-template-columns: 1fr; grid-template-rows: auto auto; width: min(480px, 100%); min-height: 0; margin: auto 0;
    border-radius: 24px; box-shadow: 0 18px 50px rgba(13, 148, 136, 0.2), 0 2px 6px rgba(15, 23, 42, 0.05); }
  .auth-art { order: -1; display: block; height: clamp(130px, 22vh, 190px); }
  #signupCard .auth-brand { display: none; }            /* registration is long enough already */
  .auth-art img { object-position: 62% 8%; }
  .auth-form { padding: 20px 20px 22px; overflow: visible; }
  .auth-brand { gap: 10px; margin-bottom: 12px; }
  .auth-brand img { width: 34px; height: 34px; border-radius: 10px; }
  .auth-brand b { font-size: 1rem; }
  .auth-brand small { font-size: 0.7rem; }
  .auth-title { font-size: 1.7rem; margin-bottom: 4px; }
  .auth-form .subtitle { font-size: 0.9rem; margin-bottom: 14px; }
  .auth-form .field { margin-bottom: 10px; }
  .auth-form input { padding-top: 12px; padding-bottom: 12px; border-radius: 12px; }
  .input-icon > svg { left: 14px; }
  .input-icon input { padding-left: 42px; }
  .auth-submit, .auth-cta, .auth-back { min-height: 48px; border-radius: 12px; font-size: 0.95rem; }
  .auth-or { margin-top: 12px; }
  .auth-or > span { margin-bottom: 10px; }
  .su-progress { margin-top: 0; }
  .su-step-label { margin-bottom: 12px; }
  .auth-form .error-msg { margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) { .auth-submit svg, .auth-cta, .auth-cta .go { transition: none; } .auth-cta:hover { transform: none; } }

/* Small phones: the two registration buttons stack, and nothing can push the form wider than the screen */
.auth-form, .auth-form .login-card, .auth-form .field, .auth-form .row > * { min-width: 0; }
.auth-form { overflow-x: hidden; }
@media (max-width: 480px) {
  .su-actions { grid-template-columns: 1fr; }
  .su-actions .auth-submit { order: 1; }
  .su-actions .auth-back { order: 2; width: 100%; }
}

/* Phones: the picture runs edge to edge at the top, and a white sheet with rounded top corners
   slides up over it. (Tablets keep the compact card above.) */
@media (max-width: 600px) {
  .auth-shell { display: block; min-height: 100dvh; padding: 0; background: #e6faf6; }
  .auth-card { display: flex; flex-direction: column; width: 100%; min-height: 100dvh; margin: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
  .auth-art { order: -1; flex: none; height: 40dvh; min-height: 230px; max-height: 360px; }
  .auth-art img { object-position: 58% 6%; }

  .auth-form { position: relative; flex: 1; margin-top: -34px; padding: 24px 22px 26px; background: #fff; border-radius: 34px 34px 0 0;
    box-shadow: 0 -12px 32px rgba(13, 148, 136, 0.14); overflow: visible; }
  .auth-form .login-card { max-width: none; }
  .auth-brand { justify-content: center; margin-bottom: 10px; }
  .auth-brand img { width: 38px; height: 38px; }
  .auth-title { text-align: center; font-size: 1.75rem; }
  .auth-form .subtitle { text-align: center; margin-bottom: 16px; }
  .su-step-label { text-align: center; }
  .auth-form .error-msg { text-align: center; }
  .auth-switch { text-align: center; }
}

/* Remember me / Forgot password */
.auth-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 14px; font-size: 0.86rem; }
.auth-check { display: flex; align-items: center; gap: 8px; margin: 0; text-transform: none; letter-spacing: 0; font-size: 0.86rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.auth-check input { width: 18px; height: 18px; padding: 0; margin: 0; accent-color: var(--primary); box-shadow: none; }

/* Floating feature icons over the picture (phones only) */
.auth-chips { display: none; }
@media (max-width: 600px) {
  .auth-art { height: 46dvh; min-height: 260px; max-height: 430px; }
  .auth-chips { display: flex; flex-direction: column; gap: 14px; position: absolute; left: 14px; top: 26%; z-index: 2; }
  .auth-chip { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: var(--primary);
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.25); }
  .auth-chip:nth-child(even) { margin-left: 10px; }
  .auth-form { border-radius: 40px 40px 0 0; padding-top: 26px; }
  .auth-brand img { width: 44px; height: 44px; border-radius: 12px; }
  .auth-brand b { font-size: 1.1rem; }
  .auth-title { font-size: 1.9rem; }
}
@media (max-width: 600px) {
  .auth-art { height: 41dvh; min-height: 240px; }
  .auth-chips { top: 22%; gap: 12px; }
  .auth-chip { width: 42px; height: 42px; }
  .auth-form { padding-top: 22px; padding-bottom: 20px; }
  .auth-brand { margin-bottom: 8px; }
  .auth-form .subtitle { margin-bottom: 12px; }
  .auth-form .field { margin-bottom: 9px; }
  .auth-options { margin: 0 0 10px; }
  .auth-or { margin-top: 10px; }
  .auth-or > span { margin-bottom: 8px; }
}

/* Phone fixes: the picture clips anything outside it, and the form starts at the top of the sheet */
@media (max-width: 600px) {
  .auth-art { overflow: hidden; }
  .auth-form { justify-content: flex-start; }
}
