/* Bularu — shared auth styles (login/register/forgot/reset/welcome/auth_layout/account shell) */
:root {
  --g: #2563eb;
  --green: #2563eb;
  --dk: #0f172a;
  --dark: #0f172a;
  --bdr: #d1d5db;
  --border: #d1d5db;
  --bg: #f9fafb;
  --red: #b3261e;
  --ok: #059669;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--dk);
  color: #111;
  min-height: 100vh;
}

/* ── Top bar (standalone auth pages) ── */
.topbar {
  background: rgba(0, 0, 0, 0.2);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  text-decoration: none;
}
.brand span {
  color: #93c5fd;
}
.topbar a {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  text-decoration: none;
}
.topbar a:hover {
  color: #fff;
}
.topbar-links {
  display: flex;
  gap: 16px;
  align-items: center;
}
.topbar-links .cta {
  background: #93c5fd;
  color: var(--dk);
  padding: 6px 16px;
  border-radius: 6px;
  font-weight: 700;
}

/* ── Auth layout shell (select shop, team, 2FA, etc.) ── */
body.auth-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-top: 70px;
}
.public-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--dark);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}
.public-nav .brand {
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
}
.public-nav .brand span {
  color: #93c5fd;
}
.public-nav a {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  text-decoration: none;
}
.public-nav a:hover {
  color: #fff;
}
.public-nav a.nav-accent {
  color: #93c5fd;
  font-weight: 600;
}
.public-nav .nav-links {
  display: flex;
  gap: 16px;
}

/* ── Centered card pages (forgot, reset, welcome, register center) ── */
body.auth-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
body.auth-stack {
  display: flex;
  flex-direction: column;
}
.center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.card,
.auth-card {
  background: #fff;
  border-radius: 14px;
  padding: 36px 40px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.28);
}
#auth-layout-card {
  padding: 36px 40px 32px;
  max-width: 480px;
}
/* Wider shell for create-shop / team forms with long content */
#auth-layout-card.auth-card-wide {
  max-width: 560px;
}
#forgot-password-card,
#reset-password-card {
  max-width: 440px;
}
.register-card {
  max-width: 520px;
}
.card-center {
  text-align: center;
}

.logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--dk);
  margin-bottom: 2px;
}
.logo span {
  color: var(--g);
}
.sub {
  font-size: 0.82rem;
  color: #6b7280;
  margin-bottom: 24px;
}
#auth-layout-card .sub {
  font-size: 0.875rem;
  margin-bottom: 28px;
}

h1 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 18px;
  color: #111;
}
h2 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 18px;
  color: #111;
}

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
}
.field {
  margin-bottom: 14px;
}
.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input:not([type]),
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--bdr);
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  background: var(--bg);
  color: #111;
  transition: border-color 0.15s;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--g);
}

/* ── Password show/hide + strength ── */
.pw-field {
  position: relative;
}
.pw-field > input[type="password"],
.pw-field > input[type="text"] {
  padding-right: 44px;
  width: 100%;
  box-sizing: border-box;
}
.pw-wrap {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.pw-wrap .pw-field {
  flex: 1;
  min-width: 0;
}
.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  z-index: 2;
}
.pw-toggle:hover {
  color: var(--g);
  background: #eff6ff;
}
.pw-toggle:focus {
  outline: 2px solid var(--g);
  outline-offset: 1px;
}
.pw-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
}
.gen-btn {
  background: var(--g);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 9px 12px;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.pw-bar-bg {
  background: #e5e7eb;
  border-radius: 4px;
  height: 4px;
  margin-top: 5px;
  overflow: hidden;
}
.pw-bar {
  height: 100%;
  width: 0;
  transition: width 0.3s, background 0.3s;
}
.pw-hint {
  font-size: 0.72rem;
  color: #9ca3af;
  min-height: 14px;
  margin-top: 2px;
}

/* ── Buttons ── */
.btn,
.btn-primary {
  display: block;
  width: 100%;
  padding: 12px;
  background: var(--g);
  color: #fff;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn:hover,
.btn-primary:hover {
  opacity: 0.87;
}
.btn-inline {
  display: inline-block;
  width: auto;
  padding: 12px 26px;
}
.btn-login {
  width: 100%;
  padding: 12px;
  background: var(--g);
  color: #fff;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-top: 4px;
}
.btn-login:hover {
  opacity: 0.87;
}
.btn-signup {
  display: block;
  width: 100%;
  padding: 11px;
  background: var(--bg);
  border: 1.5px solid var(--g);
  border-radius: 8px;
  text-align: center;
  color: var(--g);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.13s;
}
.btn-signup:hover {
  background: #eff6ff;
}
.btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

/* ── Alerts ── */
.alert-err,
.alert-e,
.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--red);
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 0.875rem;
  margin-bottom: 14px;
}
.alert-s,
.alert-success {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  border-radius: 8px;
  padding: 14px;
  font-size: 0.875rem;
  margin-bottom: 14px;
}
.alert-w {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #92400e;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
  font-size: 0.875rem;
}
.alert-notice {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 0.875rem;
  margin-bottom: 16px;
}
.alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 16px;
}

/* ── Misc ── */
hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 20px 0;
}
.divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 22px 0;
}
.alt,
.alt-link {
  text-align: center;
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 10px;
}
.alt a,
.alt-link a {
  color: var(--g);
  font-weight: 700;
}
.back {
  text-align: center;
  margin-top: 18px;
}
.back a {
  color: var(--g);
  font-weight: 600;
  font-size: 0.85rem;
}
.guide-link {
  text-align: center;
  margin-top: 16px;
}
.guide-link a {
  font-size: 0.78rem;
  color: #9ca3af;
  margin: 0 6px;
}
.auth-footer {
  text-align: center;
  padding: 12px 0;
  font-size: 0.72rem;
  color: #9ca3af;
}
.auth-footer a {
  color: #9ca3af;
}
.auth-coffee {
  text-align: center;
  padding: 16px 0 8px;
}
.auth-coffee a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffdd00;
  color: #333;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
}
.remember-note {
  font-size: 0.72rem;
  color: #9ca3af;
  text-align: center;
  margin-top: 10px;
  line-height: 1.4;
}
.build-stamp {
  font-size: 0.68rem;
  color: #64748b;
  text-align: center;
  margin-top: 8px;
  opacity: 0.85;
}
code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.82rem;
}

/* Welcome */
.tick {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ecfdf5;
  color: var(--ok);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 16px;
}
.mailbox {
  background: var(--bg);
  border: 1px solid var(--bdr);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.84rem;
  color: #334155;
  margin-bottom: 18px;
}
.welcome-sub {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 14px;
}
.welcome-sub a {
  color: var(--g);
}

/* Account page */
body.auth-account main {
  flex: 1;
  padding: 36px 24px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}
body.auth-account .card {
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 20px;
  max-width: none;
  box-shadow: none;
}
body.auth-account h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dk);
  margin-bottom: 14px;
}
body.auth-account .btn {
  width: auto;
  display: inline-block;
  padding: 10px 18px;
}
.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #dbeafe;
  color: var(--dk);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.muted-label {
  font-weight: 400;
  color: #9ca3af;
  font-size: 0.72rem;
}
.topbar-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}
.btn-ghost-logout {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}

@media (min-width: 900px) {
  body.auth-account main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 1040px;
    align-items: start;
  }
  body.auth-account main > .alert-e,
  body.auth-account main > .alert-s,
  body.auth-account main > .alert-err {
    grid-column: 1 / -1;
  }
}

@media (max-width: 500px) {
  .row2 {
    grid-template-columns: 1fr;
  }
  .card,
  .register-card {
    padding: 24px 20px;
  }
}
