/* =============================================================
   JySerai.bf — Auth gate + Plans wizard + Reviews
   ============================================================= */

/* ============ AUTH GATE ============ */
.auth-gate {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  position: relative;
  overflow: hidden;
}
.auth-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(600px 400px at 20% 30%, var(--accent-soft) 0%, transparent 60%),
    radial-gradient(700px 500px at 80% 70%, var(--accent-soft) 0%, transparent 65%);
  opacity: .7;
  z-index: 0;
}
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  padding: 40px 32px;
  box-shadow: var(--shadow-lg);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.auth-brand .logo-mark { width: 42px; height: 42px; }
.auth-brand .brand-text .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--text-strong);
  letter-spacing: -.02em;
}
.auth-brand .brand-text .name .tld { color: var(--accent); font-weight: 500; }
.auth-brand .brand-text .tag {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-top: 2px;
}
.auth-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin-bottom: 12px;
}
.auth-lead {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 28px;
}

/* Google button */
.google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  background: white;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: var(--r-md);
  font-family: 'Google Sans', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  transition: box-shadow .15s, background .15s;
  position: relative;
}
.google-btn:hover {
  box-shadow: 0 1px 3px rgba(60,64,67,.08), 0 4px 8px 3px rgba(60,64,67,.15);
  background: #f8faff;
}
.google-btn:disabled { opacity: .7; cursor: wait; }
.google-btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.google-btn-loading[hidden] { display: none !important; }
.google-btn-label[hidden] { display: none !important; }
.spinner {
  width: 16px; height: 16px;
  border: 2px solid #dadce0;
  border-top-color: #4285f4;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-subtle);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-hint {
  font-size: 12px;
  color: var(--text-subtle);
  margin-top: 8px;
  text-align: center;
  line-height: 1.5;
}
.auth-legal {
  font-size: 11px;
  color: var(--text-subtle);
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  line-height: 1.6;
}
.auth-legal a { color: var(--accent); }

/* Google account chooser */
.google-header {
  text-align: center;
  margin-bottom: 24px;
}
.google-header h2 {
  font-family: 'Google Sans', -apple-system, sans-serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-strong);
}
.account-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
.account-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 6px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: background .15s;
  font-family: inherit;
}
.account-item:hover { background: var(--surface); }
.account-item.add .acct-avatar {
  background: var(--accent-soft);
  color: var(--accent);
}
.acct-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}
.acct-info { min-width: 0; }
.acct-name { font-weight: 500; font-size: 14px; color: var(--text-strong); }
.acct-email { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.google-legal {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 20px;
  padding-top: 16px;
}
.google-legal a { color: #1a73e8; }

/* User menu in header (when signed in) */
.user-menu {
  position: relative;
}
.user-avatar-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--accent);
  color: var(--accent-fg);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s;
  font-family: inherit;
}
.user-avatar-btn:hover { border-color: var(--accent); }
.user-avatar-btn img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 6px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: all .18s var(--ease-out);
}
.user-menu.open .user-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.user-dropdown .u-head {
  padding: 14px 12px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.user-dropdown .u-name { font-weight: 600; font-size: 14px; color: var(--text-strong); }
.user-dropdown .u-email { font-size: 12px; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown .u-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.user-dropdown .u-item:hover { background: var(--surface); }
.user-dropdown .u-item.danger { color: var(--danger); }

/* ============ PLANS WIZARD MODAL ============ */
.modal-wizard { padding: 32px; }

.wizard-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.wizard-step {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.wizard-step + .wizard-step::before {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--border);
  margin-right: 10px;
}
.wizard-step .dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all .2s;
}
.wizard-step .lbl {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wizard-step.active .dot {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.wizard-step.active .lbl { color: var(--text-strong); }
.wizard-step.done .dot {
  background: var(--success);
  color: white;
  border-color: var(--success);
}
.wizard-step.done .lbl { color: var(--text); }

.wizard-head { margin-bottom: 24px; }

.plan-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.plan-pick {
  padding: 20px 16px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--bg-sunken);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all .18s var(--ease-out);
  position: relative;
  font-family: inherit;
}
.plan-pick:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.plan-pick.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 8px 20px var(--accent-soft-strong);
}
.plan-pick-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.plan-pick .plan-check {
  color: var(--accent);
}
.plan-pick-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--text-strong);
}
.plan-pick-price {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  color: var(--text-strong);
  letter-spacing: -.02em;
}
.plan-pick-price span {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 4px;
}
.plan-pick-quota { font-size: 12px; color: var(--text-muted); }

/* Payment summary */
.pay-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 20px;
}
.pay-sum-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.pay-sum-plan {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--text-strong);
  margin-top: 4px;
}
.pay-sum-price {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  color: var(--accent);
  letter-spacing: -.02em;
}
.pay-sum-price span { font-size: 14px; color: var(--text-muted); font-weight: 400; }

/* Provider grid */
.provider-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.provider-card {
  position: relative;
  padding: 16px;
  background: var(--bg-sunken);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: all .15s var(--ease-out);
  font-family: inherit;
}
.provider-card:hover { border-color: var(--border-strong); }
.provider-card.selected {
  border-color: var(--prov-color, var(--accent));
  background: color-mix(in oklab, var(--prov-color, var(--accent)) 10%, var(--bg-sunken));
}
.provider-logo {
  font-weight: 800;
  font-size: 16px;
  color: var(--prov-color);
  letter-spacing: -.02em;
}
.provider-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.provider-check {
  position: absolute;
  top: 12px; right: 12px;
  width: 20px; height: 20px;
  background: var(--prov-color);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
}

/* Phone input */
.phone-input {
  display: flex;
  align-items: stretch;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color .15s;
}
.phone-input:focus-within { border-color: var(--accent); }
.phone-input .dial {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-strong);
  white-space: nowrap;
}
.phone-input input {
  border: none;
  background: transparent;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 16px;
  flex: 1;
  letter-spacing: 2px;
  color: var(--text-strong);
  outline: none;
  min-width: 0;
}

.pay-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 16px;
}
.pay-note b { color: var(--text); }

/* OTP inputs */
.otp-inputs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 24px 0 16px;
  max-width: 380px;
  margin-inline: auto;
}
.otp-cell {
  aspect-ratio: 1;
  width: 100%;
  padding: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  color: var(--text-strong);
  background: var(--bg-sunken);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  outline: none;
  transition: all .12s var(--ease-out);
  caret-color: var(--accent);
}
.otp-cell:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.otp-cell:not(:placeholder-shown), .otp-cell[value]:not([value=""]) {
  border-color: var(--accent);
}
.otp-inputs.shake {
  animation: shake .5s cubic-bezier(.36,.07,.19,.97);
}
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}
.otp-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}
.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  font-family: inherit;
}
.link-btn:disabled { color: var(--text-subtle); cursor: not-allowed; }
.link-btn:hover:not(:disabled) { text-decoration: underline; }

.demo-code {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(245,158,11,.08);
  border: 1px dashed rgba(245,158,11,.4);
  border-radius: var(--r-sm);
  margin-top: 16px;
  font-size: 13px;
  color: var(--text);
  flex-wrap: wrap;
}
.demo-code b { color: var(--warn); font-size: 15px; letter-spacing: 3px; }

/* Success step */
.success-anim {
  display: grid;
  place-items: center;
  padding: 24px 0 8px;
}
.success-check {
  color: var(--success);
}
.success-check .path {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: draw 1s var(--ease-out) forwards;
}
.success-check .path.check { animation-delay: .5s; stroke-dashoffset: 80; animation-name: drawCheck; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes drawCheck { from { stroke-dashoffset: 80; } to { stroke-dashoffset: 0; } }

.success-summary {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 6px 16px;
  margin: 20px 0;
}
.success-summary .row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.success-summary .row:last-child { border-bottom: none; }
.success-summary .row span { color: var(--text-muted); }
.success-summary .row b { color: var(--text-strong); }

@media (max-width: 560px) {
  .plan-picker { grid-template-columns: 1fr; }
  .modal-wizard { padding: 20px; }
  .wizard-step .lbl { display: none; }
  .wizard-step + .wizard-step::before { display: none; }
}

/* ============ REVIEWS ============ */
.reviews-section { background: var(--bg-sunken); }

.reviews-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 32px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.reviews-avg {
  text-align: right;
}
.avg-stars { display: flex; gap: 2px; margin-bottom: 6px; }
.avg-meta {
  font-size: 14px;
  color: var(--text-muted);
}
.avg-meta b {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text-strong);
  margin-right: 4px;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 900px) { .review-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .review-grid { grid-template-columns: 1fr; } .reviews-head { flex-direction: column; align-items: start; } .reviews-avg { text-align: left; } }

.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all var(--dur-med) var(--ease-out);
  position: relative;
}
.review-card::before {
  content: '"';
  position: absolute;
  top: 8px; right: 20px;
  font-family: var(--font-display);
  font-size: 80px;
  line-height: 1;
  color: var(--accent);
  opacity: .15;
  pointer-events: none;
}
.review-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.review-stars {
  display: flex;
  gap: 2px;
  color: var(--accent);
}
.review-body {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  flex: 1;
  min-height: 3em;
}
.review-author {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.review-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}
.review-name {
  font-weight: 600;
  color: var(--text-strong);
  font-size: 14px;
}
.review-date {
  font-size: 12px;
  color: var(--text-muted);
}

.reviews-cta {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Rating picker (in review modal) */
.rating-picker {
  display: flex;
  gap: 4px;
  justify-content: center;
  padding: 12px 0;
}
.star-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-subtle);
  transition: color .1s, transform .1s;
}
.star-btn:hover { transform: scale(1.15); }
.star-btn.active { color: var(--accent); }

.review-signed-as {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.review-signed-as b { color: var(--text); }
