/* ============================================================
   auth.css — Sign in / Join / Onboarding (Fiverr-style split card)
   Uses the theme tokens from styles.css — works in light + dark, LTR + RTL.
   ============================================================ */

.auth-body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse 70% 55% at 10% 0%, var(--blue-dim) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 100%, var(--indigo-dim) 0%, transparent 60%),
    var(--bg);
  color: var(--text);
}

/* ── Top bar: logo left, toggles right ── */
.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 20px 0;
  box-sizing: border-box;
}
.auth-topbar .logo { font-size: 1.55rem; }
.auth-tools { display: flex; gap: 8px; align-items: center; }
.auth-tool-btn {
  height: 40px;
  min-width: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text-2);
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.auth-tool-btn:hover { color: var(--blue); border-color: var(--blue-border); }

/* ── Page + split card ── */
.auth-page {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px 48px;
  box-sizing: border-box;
}
.auth-shell {
  width: 100%;
  max-width: 1000px;
  display: grid;
  grid-template-columns: 5fr 6fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

/* Left hero panel */
.auth-hero {
  position: relative;
  padding: 48px 40px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 90%, rgba(255,255,255,.18) 0, transparent 38%),
    radial-gradient(circle at 10% 15%, rgba(255,255,255,.12) 0, transparent 30%),
    linear-gradient(145deg, #1e3a8a 0%, #2563eb 48%, #4f46e5 100%);
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow: hidden;
}
.auth-hero h2 {
  margin: 0;
  font-size: 2.3rem;
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -.02em;
}
.auth-hero ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.auth-hero li { display: flex; gap: 12px; align-items: flex-start; font-size: 1.02rem; font-weight: 600; line-height: 1.45; }
.auth-hero li::before {
  content: '✓';
  flex: 0 0 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  display: grid;
  place-items: center;
  font-size: .8rem;
  font-weight: 900;
  margin-top: 1px;
}
/* decorative floating "gig cards" */
.auth-hero-art { margin-top: auto; position: relative; height: 150px; }
.hero-chip {
  position: absolute;
  background: rgba(255,255,255,.95);
  color: #1a2b4a;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: .8rem;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .28);
  display: flex;
  gap: 10px;
  align-items: center;
}
.hero-chip small { display: block; font-weight: 600; color: #64748b; font-size: .72rem; }
.hero-chip .dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 1.05rem; background: #eef2ff; }
.hero-chip.c1 { left: 0; top: 8px; transform: rotate(-3deg); }
.hero-chip.c2 { right: 0; top: 58px; transform: rotate(3deg); }
.hero-chip.c3 { left: 18%; bottom: 0; }
[dir="rtl"] .hero-chip.c1 { left: auto; right: 0; transform: rotate(3deg); }
[dir="rtl"] .hero-chip.c2 { right: auto; left: 0; transform: rotate(-3deg); }
[dir="rtl"] .hero-chip.c3 { left: auto; right: 18%; }

/* Right form panel */
.auth-main {
  padding: 44px 44px 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.auth-title { margin: 0; font-size: 1.65rem; font-weight: 900; letter-spacing: -.02em; color: var(--text); }
.auth-switch { margin: 0; font-size: .95rem; color: var(--text-2); }
.auth-switch a, .auth-link-btn {
  color: var(--blue);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-size: inherit;
}

.auth-step { margin: 6px 0 -6px; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }

/* Google button slot (GIS renders its own iframe button in here) */
.auth-google { min-height: 44px; display: flex; justify-content: center; }
.auth-google-off {
  width: 100%;
  text-align: center;
  font-size: .85rem;
  color: var(--text-3);
  border: 1px dashed var(--border-2);
  border-radius: 999px;
  padding: 12px;
}
.auth-google.is-locked { opacity: .45; filter: grayscale(1); cursor: not-allowed; }
.auth-google.is-locked > * { pointer-events: none; }

/* Divider */
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: .82rem; font-weight: 700; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-2); }

/* Role cards */
.role-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.role-card {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: start;
  padding: 14px;
  border-radius: 14px;
  border: 2px solid var(--border-2);
  background: var(--bg-2);
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
  font: inherit;
}
.role-card:hover { border-color: var(--blue-border); transform: translateY(-1px); }
.role-card.is-active { border-color: var(--blue); background: var(--blue-dim); box-shadow: 0 0 0 3px var(--blue-dim); }
.role-ico { font-size: 1.5rem; flex: 0 0 auto; }
.role-txt b { display: block; font-size: .95rem; }
.role-txt small { display: block; color: var(--text-2); font-size: .78rem; margin-top: 2px; line-height: 1.35; }

/* Form */
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-label { font-size: .8rem; font-weight: 800; color: var(--text-2); }
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  color: var(--text);
  font-size: .95rem;
  padding: 12px 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.auth-input-wrap .auth-input { padding-inline-end: 44px; }
.auth-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-dim); }
.auth-input::placeholder { color: var(--text-3); }
.auth-input--error { border-color: rgba(239,68,68,.6) !important; box-shadow: 0 0 0 3px rgba(239,68,68,.12) !important; }
.auth-field-error { font-size: .76rem; color: #ef4444; font-weight: 700; min-height: 14px; }
.auth-eye {
  position: absolute;
  inset-inline-end: 10px;
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-3);
  padding: 4px;
}

.auth-submit {
  width: 100%;
  padding: 13px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: filter .15s, transform .15s;
}
.auth-submit:hover { filter: brightness(1.08); }
.auth-submit:disabled { opacity: .6; cursor: default; }
.auth-submit--ghost { background: transparent; color: var(--blue); border: 1px solid var(--blue-border); }

.auth-terms { margin: 4px 0 0; font-size: .76rem; color: var(--text-3); line-height: 1.5; }

/* Messages */
.auth-msg { padding: 12px 14px; border-radius: 12px; font-size: .88rem; font-weight: 700; display: none; line-height: 1.45; }
.auth-msg--error { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #ef4444; }
.auth-msg--success { background: var(--emerald-dim); border: 1px solid var(--emerald-border); color: var(--emerald); }
.auth-msg--info { background: var(--blue-dim); border: 1px solid var(--blue-border); color: var(--blue); }

/* "Check your inbox" state */
.auth-sent { display: none; flex-direction: column; gap: 14px; text-align: center; align-items: center; padding: 10px 0; }
.auth-sent.is-on { display: flex; }
.auth-sent-ico { font-size: 3rem; }
.auth-sent p { margin: 0; color: var(--text-2); line-height: 1.55; }

/* Modal (role picker for new Google users on the login page) */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(8, 12, 22, .6);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 20px;
}
.auth-modal-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 18px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-md);
}
.auth-modal-title { margin: 0; font-size: 1.35rem; font-weight: 900; }
.auth-modal-sub { margin: 0; color: var(--text-2); }
.auth-modal-cancel { align-self: center; }

/* ── Onboarding (category picker) ── */
.ob-shell { max-width: 820px; grid-template-columns: 1fr; }
.ob-main { padding: 40px 40px 32px; gap: 20px; }
.ob-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.ob-cat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 14px;
  border: 2px solid var(--border-2);
  background: var(--bg-2);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: start;
  transition: border-color .15s, background .15s, transform .15s;
}
.ob-cat:hover { border-color: var(--blue-border); transform: translateY(-1px); }
.ob-cat .ob-ico { font-size: 1.6rem; }
.ob-cat .ob-name { font-weight: 800; font-size: .92rem; line-height: 1.3; }
.ob-cat.is-on { border-color: var(--blue); background: var(--blue-dim); }
.ob-cat.is-on::after {
  content: '✓';
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: .75rem;
  font-weight: 900;
  display: grid;
  place-items: center;
}
.ob-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ob-count { font-weight: 800; color: var(--text-2); }
.ob-foot .auth-submit { width: auto; padding: 13px 28px; }

/* ── Responsive ── */
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { padding: 28px 24px; gap: 16px; }
  .auth-hero h2 { font-size: 1.6rem; }
  .auth-hero ul { gap: 8px; }
  .auth-hero li { font-size: .9rem; }
  .auth-hero-art { display: none; }
  .auth-main, .ob-main { padding: 28px 22px; }
}
@media (max-width: 480px) {
  .auth-page { padding: 16px 12px 32px; }
  .role-cards { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-title { font-size: 1.4rem; }
  .ob-grid { grid-template-columns: 1fr 1fr; }
  .ob-foot .auth-submit { width: 100%; }
}
