﻿/* Top bar + auth modals — BeautyVIA */

.site-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(3, 3, 6, 0.88);
  backdrop-filter: blur(16px) saturate(1.2);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.55rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  flex-wrap: nowrap;
  min-width: 0;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  min-width: 0;
  position: relative;
  z-index: 2;
}

.topbar-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28em;
  font-family: var(--font-brand, "Syne", sans-serif);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: inherit;
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
  transition: filter 0.3s ease;
}

.topbar-logo .logo-mark {
  color: var(--champagne, #e8d5b5);
  text-shadow: 0 0 18px rgba(232, 213, 181, 0.3);
}

.topbar-logo .logo-beauty {
  color: #f4f7fb;
}

.topbar-logo .logo-via {
  color: var(--cyan, #00e8f0);
  text-shadow: 0 0 18px rgba(0, 232, 240, 0.35);
}

.topbar-logo:hover {
  filter: brightness(1.08);
}

.beta-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0;
  padding: 0.12rem 0.45rem;
  border: 1px solid rgba(0, 232, 240, 0.45);
  border-radius: 999px;
  font-family: var(--font-ui, "Rajdhani", sans-serif);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan, #00e8f0);
  background: rgba(0, 232, 240, 0.08);
  flex-shrink: 0;
}

.beta-badge.hidden {
  display: none !important;
}

.topbar-logo:hover .logo-mark {
  color: #fff;
}

.topbar-logo:hover .logo-via {
  text-shadow: 0 0 26px rgba(0, 232, 240, 0.5);
}

.topbar-auth {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 1;
  min-width: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: nowrap;
  justify-content: flex-end;
  margin-left: auto;
  min-width: 0;
  flex: 1 1 auto;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.topbar-nav .btn-auth-ghost {
  text-decoration: none;
  white-space: nowrap;
  padding: 0.38rem 0.7rem;
  font-size: 0.66rem;
}

.topbar-right .locale-select {
  padding: 0.35rem 1.3rem 0.35rem 0.5rem;
  min-width: 2.85rem;
  font-size: 0.6rem;
}

.topbar-right .locale-select-code {
  left: 0.5rem;
  font-size: 0.6rem;
}

@media (max-width: 1100px) {
  .auth-name {
    max-width: 7.5rem;
  }
}

@media (max-width: 920px) {
  .topbar-nav {
    display: none;
  }
}

@media (max-width: 720px) {
  .topbar-inner {
    padding: 0.45rem 0.75rem;
    gap: 0.5rem;
  }

  .auth-name {
    display: none;
  }

  .auth-avatar,
  .auth-avatar-ph {
    width: 30px;
    height: 30px;
  }

  .topbar-auth .btn-auth-ghost,
  .topbar-auth .btn-auth-primary {
    padding: 0.32rem 0.55rem;
    font-size: 0.58rem;
  }
}

.locale-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.locale-select-code {
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  pointer-events: none;
  color: var(--champagne, #e8d5b5);
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  line-height: 1;
}

.locale-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
  /* Native closed-state text is unreliable with custom fonts — overlay shows code */
  color: transparent;
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  padding: 0.4rem 1.4rem 0.4rem 0.55rem;
  min-width: 3.1rem;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--champagne, #e8d5b5) 50%),
    linear-gradient(135deg, var(--champagne, #e8d5b5) 50%, transparent 50%);
  background-position: calc(100% - 12px) calc(50% - 2px), calc(100% - 7px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.locale-select option {
  background: #0a0e14;
  color: var(--text);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.btn-auth-ghost,
.btn-auth-primary {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  padding: 0.45rem 0.85rem;
  border-radius: 2px;
  cursor: pointer;
  transition: box-shadow 0.2s, background 0.2s;
}

.btn-auth-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--champagne, #e8d5b5);
}

.btn-auth-ghost:hover {
  border-color: rgba(232, 213, 181, 0.5);
  box-shadow: 0 0 20px rgba(232, 213, 181, 0.15);
}

.btn-auth-primary {
  background: linear-gradient(115deg, rgba(232, 213, 181, 0.18), rgba(0, 232, 240, 0.12));
  border: 1px solid rgba(232, 213, 181, 0.45);
  color: var(--champagne, #e8d5b5);
}

.btn-auth-primary:hover {
  background: linear-gradient(115deg, rgba(232, 213, 181, 0.28), rgba(0, 232, 240, 0.18));
}

.auth-user {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
  min-width: 0;
}

.auth-avatar,
.auth-avatar-ph {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(0, 243, 255, 0.4);
  flex-shrink: 0;
  object-fit: cover;
}

.auth-avatar {
  display: block;
  background-color: #0a1220;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='32' r='32' fill='%230a1220'/%3E%3Ccircle cx='32' cy='24' r='11' fill='%231a2a3d'/%3E%3Cellipse cx='32' cy='52' rx='18' ry='14' fill='%231a2a3d'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

.auth-avatar-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 42, 109, 0.2);
  color: var(--magenta);
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.auth-user-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.auth-user-text--row {
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.4rem;
  min-width: 0;
}

.auth-name {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9.5rem;
}

.auth-plan-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0.12rem 0.42rem;
  border: 1px solid rgba(232, 213, 181, 0.55);
  background: linear-gradient(
    120deg,
    rgba(232, 213, 181, 0.22),
    rgba(0, 243, 255, 0.12)
  );
  color: var(--champagne, #e8d5b5);
  font-family: var(--font-display, Orbitron, sans-serif);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
}

.auth-plan-badge[data-plan="salon_business"],
.auth-plan-badge[data-plan="salon"] {
  border-color: rgba(0, 243, 255, 0.55);
  color: var(--cyan, #00f3ff);
  background: linear-gradient(
    120deg,
    rgba(0, 243, 255, 0.18),
    rgba(232, 213, 181, 0.1)
  );
}

.auth-plan-badge[data-plan="salon_pro"] {
  border-color: rgba(232, 213, 181, 0.75);
  color: #fff4dc;
  background: linear-gradient(
    120deg,
    rgba(232, 213, 181, 0.32),
    rgba(255, 255, 255, 0.08)
  );
}

.auth-plan-badge[data-plan="salon_studio"] {
  border-color: rgba(255, 214, 102, 0.75);
  color: #ffe9a8;
  background: linear-gradient(
    120deg,
    rgba(255, 214, 102, 0.28),
    rgba(0, 243, 255, 0.12)
  );
}

.auth-plan-badge[data-plan="free"] {
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--muted, #9aa4b2);
  background: rgba(255, 255, 255, 0.06);
}

.auth-meta {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.auth-meta b {
  color: var(--cyan);
}

.auth-credits-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.auth-credits-plus {
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(0, 232, 240, 0.4);
  background: rgba(0, 232, 240, 0.08);
  color: var(--cyan);
  font-size: 0.85rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
}

.auth-credits-plus:hover {
  background: var(--cyan);
  color: #050508;
}

/* Modal */

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-modal.hidden {
  display: none;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
}

.auth-modal-panel {
  position: relative;
  width: min(420px, 100%);
  padding: 1.85rem 1.55rem 1.55rem;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.04), transparent 45%),
    rgba(6, 8, 16, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(232, 213, 181, 0.08),
    inset 0 0 60px rgba(0, 232, 240, 0.03);
}

.auth-modal-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--champagne, #e8d5b5), var(--cyan), transparent);
}

.auth-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.65rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.auth-modal-close:hover {
  color: var(--magenta);
}

.auth-modal-title {
  font-family: var(--font-brand, var(--font-display));
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 0.25rem;
  color: var(--champagne, #e8d5b5);
}

.auth-modal-sub {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.auth-tab {
  flex: 1;
  padding: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  cursor: pointer;
}

.auth-tab.active {
  border-color: rgba(232, 213, 181, 0.45);
  color: var(--champagne, #e8d5b5);
  background: rgba(232, 213, 181, 0.08);
}

.auth-error {
  color: #ff6b8a;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  border: 1px solid rgba(255, 42, 109, 0.4);
  background: rgba(255, 42, 109, 0.08);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.auth-form label span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.auth-form input {
  font-family: var(--font);
  font-size: 1rem;
  padding: 0.55rem 0.65rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 243, 255, 0.25);
  color: var(--text);
  border-radius: 2px;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.25);
}

.auth-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.btn-auth-submit {
  margin-top: 0.25rem;
  padding: 0.75rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  background: linear-gradient(115deg, var(--champagne, #e8d5b5) 0%, #fff 42%, var(--cyan) 100%);
  border: 1px solid transparent;
  color: #050508;
  cursor: pointer;
  border-radius: 2px;
  transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;
}

.btn-auth-submit:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(232, 213, 181, 0.22);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.75rem 1rem;
  text-decoration: none;
  font-family: var(--font);
  font-weight: 600;
  font-size: 1rem;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-google:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.btn-google.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.btn-google-svg {
  flex-shrink: 0;
}

.btn-google-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  color: #4285f4;
  font-weight: 700;
  font-size: 0.85rem;
}

.auth-google-wrap {
  margin-bottom: 0.25rem;
}

.auth-google-hint {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--magenta);
  text-align: center;
  line-height: 1.35;
}

.auth-verify-pending {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}

.auth-verify-title {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  color: var(--cyan);
}

.auth-verify-text {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.auth-verify-text strong {
  color: var(--text);
}

.auth-resend-wrap {
  text-align: center;
  margin: 0 0 0.75rem;
}

.auth-resend-ok {
  margin: 0 0 0.75rem;
  color: var(--cyan);
  font-size: 0.9rem;
  text-align: center;
}


@media (max-width: 520px) {
  .auth-user-text {
    display: none;
  }
  .auth-form-row {
    grid-template-columns: 1fr;
  }
}
