/* Shared YourWord pages — matches Director’s Studio palette. */
:root {
  --bg: #f3ecdd;
  --bg-2: #ede4d1;
  --card: #fdfaf2;
  --card-2: #fffdf8;
  --ink: #2c2214;
  --muted: #8a7c64;
  --muted-2: #ab9d84;
  --border: #e0d4bc;
  --border-strong: #d2c3a6;
  --accent: #8b572a;
  --accent-strong: #7a4a1f;
  --accent-soft: rgba(139, 87, 42, 0.09);
  --accent-border: rgba(139, 87, 42, 0.35);
  --topbar: #161310;
  --topbar-ink: #f6f1e6;
  --good: #4f8f68;
  --danger: #b45b48;
  --radius: 14px;
  --radius-lg: 20px;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Instrument Serif", Georgia, serif;
  --shadow: 0 22px 55px rgba(60, 42, 20, 0.16);
  --shadow-soft: 0 10px 30px rgba(60, 42, 20, 0.1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
}

body {
  background-image:
    radial-gradient(90% 60% at 50% -10%, rgba(139, 87, 42, 0.07), transparent 60%),
    linear-gradient(180deg, #f6f0e2 0%, #f0e7d4 100%);
  background-attachment: fixed;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

.brand {
  margin: 0;
  font-family: var(--display);
  font-size: 1.6rem;
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--ink);
}

.yw-logo-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}

.yw-logo {
  height: 28px;
  width: auto;
  display: block;
}

.text-accent {
  color: var(--accent) !important;
}

.btn-studio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #966130, var(--accent-strong));
  color: #fdf6ea;
  font-weight: 650;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(122, 74, 31, 0.28);
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.btn-studio:hover {
  box-shadow: 0 12px 26px rgba(122, 74, 31, 0.36);
  transform: translateY(-1px);
  color: #fdf6ea;
}

/* ---------- Auth cards (login / register / reset) ---------- */

body.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  color: var(--ink);
}

.auth-card {
  background: var(--card);
  padding: 1.6rem 1.4rem;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow);
  width: 90%;
  max-width: 400px;
  text-align: center;
  margin: auto;
}

.auth-card .brand {
  margin-bottom: 0.35rem;
}

.auth-card .auth-kicker {
  margin: 0 0 1.15rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.auth-card h2 {
  margin: 0 0 1.25rem;
  font-family: var(--display);
  font-weight: 400;
  color: var(--ink);
  font-size: 1.7rem;
}

.auth-card form {
  display: flex;
  flex-direction: column;
}

.auth-card .form-group {
  text-align: left;
  margin-bottom: 0.9rem;
}

.auth-card label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--ink);
}

.auth-card input[type="text"],
.auth-card input[type="password"],
.auth-card input[type="email"] {
  padding: 0.85rem 0.95rem;
  margin-bottom: 0.85rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  font-size: 1rem;
  width: 100%;
  background: var(--card-2);
  color: var(--ink);
}

.auth-card .form-group input {
  margin-bottom: 0;
}

.auth-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.auth-card button[type="submit"],
.auth-card button:not(.social-btn):not(.voice-play) {
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #966130, var(--accent-strong));
  color: #fdf6ea;
  font-weight: 650;
  width: 100%;
  box-shadow: 0 8px 20px rgba(122, 74, 31, 0.28);
}

.auth-card button[type="submit"]:hover,
.auth-card button:not(.social-btn):hover {
  box-shadow: 0 12px 26px rgba(122, 74, 31, 0.36);
}

.auth-card a {
  display: block;
  margin-top: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.auth-card a:hover {
  color: var(--accent-strong);
}

.auth-card .error,
.auth-card .message,
.auth-card .errorlist {
  color: var(--danger);
  margin-bottom: 1rem;
  font-size: 0.85rem;
  text-align: left;
}

.auth-card .errorlist {
  list-style: none;
  padding-left: 0;
}

.auth-card .success {
  color: var(--good);
  margin-bottom: 1rem;
}

.auth-card .description {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
  text-align: left;
  line-height: 1.45;
}

.auth-card .password-hints {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  text-align: left;
}

.auth-card .checkbox-group {
  margin-bottom: 1rem;
}

.auth-card .checkbox-container {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.auth-card .checkbox-label {
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0;
  cursor: pointer;
  flex: 1;
  text-align: left;
  font-weight: 500;
  color: var(--ink);
}

.auth-card .checkbox-label a {
  margin-top: 0;
  color: var(--accent);
  text-decoration: underline;
  white-space: nowrap;
}

.auth-card .required {
  color: var(--danger);
  font-weight: 700;
}

.auth-card input[type="checkbox"] {
  width: auto;
  margin: 0.2rem 0 0;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.auth-card .honeypot-field {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.help-links {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.85rem;
  font-size: 0.8rem;
}

.help-links a {
  margin-top: 0;
  color: var(--muted);
  text-decoration: underline;
  font-weight: 500;
}

.help-links a:hover {
  color: var(--accent);
}

.auth-card a.other-login-toggle {
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  display: block;
}

.social-login {
  margin-top: 1.35rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.social-login p {
  position: relative;
  margin-bottom: 1.1rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.social-login p::before,
.social-login p::after {
  content: "";
  display: inline-block;
  width: 28%;
  height: 1px;
  background-color: var(--border-strong);
  position: absolute;
  top: 50%;
}

.social-login p::before { left: 0; }
.social-login p::after { right: 0; }

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.7rem;
  margin: 0 0 0.75rem;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--border-strong);
  background: var(--card-2);
  color: var(--ink);
}

.auth-card a.social-btn {
  display: flex;
  margin-top: 0;
  color: var(--ink);
}

.auth-card .help-links a,
.auth-card .checkbox-label a {
  display: inline;
}

.social-btn:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.social-btn img,
.social-btn svg {
  height: 1.35rem;
  width: 1.35rem;
}

.social-login.collapsible { display: none; }
.social-login.collapsible.expanded { display: block; }

.auth-or {
  margin: 1rem 0;
  color: var(--muted);
  font-size: 0.86rem;
}

#otp-error {
  color: var(--danger);
}

@media (min-width: 600px) {
  .auth-card {
    padding: 2.4rem 2.2rem;
    max-width: 440px;
  }
  .auth-card h2 {
    font-size: 2rem;
  }
}

/* ---------- Billing / subscriptions ---------- */

.billing-header {
  background: var(--topbar);
  color: var(--topbar-ink);
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  flex: 0 0 auto;
  align-self: stretch;
}

.billing-header .brand {
  color: var(--topbar-ink);
  font-size: 1.25rem;
  text-decoration: none;
}

.billing-header a {
  color: var(--topbar-ink);
  text-decoration: none;
}

.billing-chip {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--topbar-ink);
  border-radius: 999px;
  padding: 0.35rem 0.75rem 0.35rem 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.billing-chip:hover {
  border-color: rgba(236, 192, 125, 0.6);
}

.billing-avatar {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #b57a3f, #8b572a);
  color: #fdf6ea;
  font-weight: 700;
}

.billing-title {
  font-family: var(--display);
  font-weight: 400;
  color: var(--ink);
}

.billing-sub {
  color: var(--muted);
}

.billing-sub a {
  color: var(--accent);
  font-weight: 600;
}

.billing-footer {
  background: var(--topbar);
  color: rgba(246, 241, 230, 0.7);
  padding: 2rem 1rem;
  margin-top: 4rem;
}

.plan-card {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1.5px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.plan-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: var(--accent-border);
}

.plan-card.current-plan {
  border: 2px solid var(--accent);
}

.current-plan-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--accent);
  color: #fdf6ea;
  padding: 0.45rem 0.9rem;
  font-size: 0.72rem;
  font-weight: 650;
  border-bottom-left-radius: 0.7rem;
}

.canceling-badge {
  background: var(--danger) !important;
}

.feature-check {
  color: var(--accent);
}

.btn-studio-inline {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.8rem 1rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #966130, var(--accent-strong));
  color: #fdf6ea !important;
  font-weight: 650;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(122, 74, 31, 0.28);
}

.btn-studio-inline:hover {
  box-shadow: 0 12px 26px rgba(122, 74, 31, 0.36);
}

.tier-tab:hover {
  background-color: var(--accent-soft);
}

.modal {
  display: none;
  position: fixed;
  z-index: 50;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(44, 34, 20, 0.45);
}

.modal-content {
  background-color: var(--card);
  margin: 12% auto;
  padding: 1.4rem;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-strong);
  width: 80%;
  max-width: 500px;
  box-shadow: var(--shadow);
  color: var(--ink);
}

.billing-compare {
  background: var(--card);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.billing-compare-head {
  background: var(--bg-2);
  border-color: var(--border);
}
