/* ---------------------------------------------------------------------------
 * Styles for the shared account layer (assets/auth.js).
 *
 * Loaded by BOTH the studio and the marketing/home page, because the sign-in
 * dialog is the same on both and the home page does not load the studio's
 * styles.css. Everything is scoped under .ov-auth-backdrop (the class auth.js
 * puts on its own dialogs) so these rules can never reach another modal.
 *
 * Base overlay/card rules are repeated here rather than relied upon: on the home
 * page there is nothing else to provide them.
 * --------------------------------------------------------------------------- */

.ov-auth-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, .45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9000;              /* above the studio's own modals (8000) */
  padding: 20px;
}
.ov-auth-backdrop.show { display: flex; }

.ov-auth-backdrop .modal {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 20px;
  padding: 44px 28px 28px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .2);
  opacity: 0;
  transform: scale(.95) translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  font-family: inherit;
  color: #18181b;
}
.ov-auth-backdrop.show .modal { opacity: 1; transform: scale(1) translateY(0); }

.ov-auth-backdrop .modal-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: none;
  cursor: pointer;
  color: #8a8a94;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ov-auth-backdrop .modal-x:hover { background: rgba(0, 0, 0, .05); }

.ov-auth-backdrop .login-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
}
.ov-auth-backdrop .login-body {
  font-size: 14.5px;
  font-weight: 400;
  color: #6b6b76;
  line-height: 1.55;
  margin: 0;
}
.ov-auth-backdrop .login-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}
/* The Google button leads; "Not now" sits beside it as a real option, because the
   prompt is dismissible and an account is genuinely not required. */
.ov-auth-backdrop .login-google {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 12px;
  border: 1px solid #e4e4e7;
  background: #fff;
  color: #18181b;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.ov-auth-backdrop .login-google:hover:not(:disabled) { background: #f5f5f7; }
.ov-auth-backdrop .login-google:disabled { cursor: default; opacity: .75; }
.ov-auth-backdrop .login-later {
  height: 40px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #6b6b76;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.ov-auth-backdrop .login-later:hover { background: #f5f5f7; }

/* Account dialog: the photo, then the name/email, then a plain sign-out. */
.ov-auth-backdrop .acct-av {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 14px;
  display: block;
}
.ov-auth-backdrop .acct-av-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #18181b;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}

/* Busy spinner for the sign-in button (styles.css has its own for the studio,
   but the home page does not load it). */
.ov-auth-backdrop .btn-spin {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, .18);
  border-top-color: #18181b;
  border-radius: 50%;
  display: inline-block;
  animation: ov-auth-spin .7s linear infinite;
}
@keyframes ov-auth-spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------------
 * Professional multi-provider sign-in dialog (assets/auth.js loginModal).
 * Scoped under .ov-auth-backdrop so nothing here can reach another modal.
 * --------------------------------------------------------------------------- */

/* One robust rule for every toggled element in this dialog. Several of them use
   display:flex/block via their class, which would otherwise beat the UA
   [hidden]{display:none} — the exact specificity trap that left a hidden item
   visible earlier. Scoped + !important here is deliberate and safe. */
.ov-auth-backdrop [hidden] { display: none !important; }

.ov-auth-backdrop .ovl-card {
  max-width: 400px;
  padding: 30px 28px 20px;
  text-align: left;
}
.ov-auth-backdrop .ovl-head { text-align: center; margin-bottom: 20px; }
.ov-auth-backdrop .ovl-title { font-size: 20px; font-weight: 700; line-height: 1.3; }
.ov-auth-backdrop .ovl-sub {
  margin-top: 8px; font-size: 13px; line-height: 1.5; color: #6b6b76;
}

/* Social buttons — neutral white with the brand glyph, stacked full-width. */
/* Gate badge — names the situation in two words so the dialog does not feel like
   it appeared out of nowhere. */
.ov-auth-backdrop .ovl-badge {
  display: inline-block; margin-bottom: 10px; padding: 4px 10px; border-radius: 999px;
  background: #fff1f0; color: #d1453b; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em;
}

/* Why sign in. Only claims that are true today (see auth.js). */
.ov-auth-backdrop .ovl-why {
  list-style: none; margin: 0 0 18px; padding: 14px 14px 12px;
  background: #fafafa; border-radius: 12px; text-align: left;
}
.ov-auth-backdrop .ovl-why li {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 13px; line-height: 1.45; color: #3f3f46; padding: 4px 0;
}
.ov-auth-backdrop .ovl-why-ic { flex: none; margin-top: 2px; color: #16a34a; }

.ov-auth-backdrop .ovl-social { display: flex; flex-direction: column; gap: 10px; }
.ov-auth-backdrop .ovl-oauth {
  height: 46px; display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid #e4e4e7; border-radius: 12px; background: #fff; color: #18181b;
  font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer;
}
.ov-auth-backdrop .ovl-oauth:hover:not(:disabled) { background: #f5f5f7; }
.ov-auth-backdrop .ovl-oauth:disabled { opacity: .7; cursor: default; }

.ov-auth-backdrop .ovl-or {
  display: flex; align-items: center; gap: 12px; margin: 16px 0; color: #a1a1aa; font-size: 12px;
}
.ov-auth-backdrop .ovl-or::before,
.ov-auth-backdrop .ovl-or::after { content: ""; flex: 1; height: 1px; background: #ececf0; }

.ov-auth-backdrop .ovl-form { display: flex; flex-direction: column; gap: 12px; }
.ov-auth-backdrop .ovl-field { display: flex; flex-direction: column; gap: 6px; }
.ov-auth-backdrop .ovl-field > span { font-size: 12.5px; font-weight: 600; color: #52525b; }
.ov-auth-backdrop .ovl-field input {
  height: 44px; border: 1px solid #e4e4e7; border-radius: 10px; padding: 0 12px;
  font-size: 15px; font-family: inherit; color: #18181b; background: #fff; width: 100%;
  box-sizing: border-box; outline: none;
}
.ov-auth-backdrop .ovl-field input:focus {
  border-color: #fe655d; box-shadow: 0 0 0 3px rgba(254,101,93,.14);
}
.ov-auth-backdrop .ovl-pw-wrap { position: relative; display: block; }
.ov-auth-backdrop .ovl-pw-wrap input { padding-right: 44px; }
.ov-auth-backdrop .ovl-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer; color: #a1a1aa; border-radius: 8px;
}
.ov-auth-backdrop .ovl-eye:hover { color: #52525b; background: #f5f5f7; }
.ov-auth-backdrop .ovl-eye-on { color: #fe655d; }

.ov-auth-backdrop .ovl-row-end { display: flex; justify-content: flex-end; }
.ov-auth-backdrop .ovl-hint { font-size: 12px; color: #8a8a94; }

.ov-auth-backdrop .ovl-primary {
  height: 46px; width: 100%; display: block; border: none; border-radius: 12px;
  background: #18181b; color: #fff; font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer; margin-top: 2px;
}
.ov-auth-backdrop .ovl-primary:hover:not(:disabled) { background: #2b2b30; }
.ov-auth-backdrop .ovl-primary:disabled { opacity: .75; cursor: default; }

.ov-auth-backdrop .ovl-link {
  border: none; background: none; padding: 0; cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 600; color: #fe655d;
}
.ov-auth-backdrop .ovl-link:hover { text-decoration: underline; }

.ov-auth-backdrop .ovl-switch { text-align: center; margin-top: 16px; font-size: 13.5px; color: #52525b; }
.ov-auth-backdrop .ovl-alt { display: block; width: 100%; text-align: center; margin-top: 14px; }
.ov-auth-backdrop .ovl-back { display: inline-flex; margin-bottom: 4px; }

.ov-auth-backdrop .ovl-error {
  margin-top: 12px; padding: 9px 12px; border-radius: 9px;
  background: #fef2f2; color: #b91c1c; font-size: 13px; line-height: 1.45;
}
.ov-auth-backdrop .ovl-error.ovl-ok { background: #f0fdf4; color: #15803d; }

.ov-auth-backdrop .ovl-legal {
  margin-top: 16px; font-size: 11px; line-height: 1.5; color: #a1a1aa; text-align: center;
}

/* ---------------------------------------------------------------------------
 * Overflow / mobile. This dialog is content-heavy (badge + reasons + social +
 * email + phone), so on short viewports — and especially on a phone once the
 * on-screen keyboard is up — it is taller than the screen. Flex-centering on its
 * own would clip the top and bottom with no way to scroll to them. Letting the
 * backdrop scroll and centering the card with auto margins keeps it centred when
 * it fits and reachable when it doesn't.
 * --------------------------------------------------------------------------- */
.ov-auth-backdrop { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ov-auth-backdrop .modal { margin: auto; }

@media (max-width: 480px) {
  .ov-auth-backdrop { padding: 12px; align-items: flex-start; }
  .ov-auth-backdrop .modal { max-width: 100%; border-radius: 16px; }
  .ov-auth-backdrop .ovl-card { padding: 26px 18px 16px; }
  .ov-auth-backdrop .ovl-title { font-size: 18px; }
  .ov-auth-backdrop .ovl-why { padding: 12px 12px 10px; margin-bottom: 14px; }
  .ov-auth-backdrop .ovl-why li { font-size: 12.5px; }
  /* 16px stops iOS Safari from zooming the whole page when a field is focused. */
  .ov-auth-backdrop .ovl-field input { font-size: 16px; }
}

/* ---------------------------------------------------------------------------
 * Home-page header control (see assets/homepage/home-auth.js). Hidden until the
 * server confirms sign-in is live, so a build with accounts off is unchanged.
 * --------------------------------------------------------------------------- */
.fp-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: none;          /* never shrink: it sits next to the header's CTA */
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #e4e4e7;
  background: #fff;
  color: #18181b;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.fp-auth-btn:hover { background: #f5f5f7; }
.fp-auth-btn[hidden] { display: none; }
/* Signed in: collapse to just the avatar. */
.fp-auth-btn.fp-auth-signed-in {
  width: 38px;
  padding: 0;
  justify-content: center;
  overflow: hidden;
  border-color: transparent;
  background: none;
}
.fp-auth-av { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: block; }
.fp-auth-ic { flex: none; color: #52525b; }
.fp-auth-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #18181b;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
@media (max-width: 640px) {
  /* Keep the header from wrapping on small screens: the icon carries it. */
  .fp-auth-label { display: none; }
  .fp-auth-btn { width: 38px; padding: 0; justify-content: center; }
}
