﻿/**
 * ALYA BUTIK — Auth
 * Sign-in modal, Google/Apple buttons, user avatar & dropdown
 */

/* ============================================================
   AUTH MODAL
   ============================================================ */

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(10, 8, 6, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.auth-modal.is-open {
  opacity: 1;
  pointer-events: all;
}

.auth-modal__box {
  background: #FAF7F2;
  width: 100%;
  max-width: 400px;
  padding: 2.5rem 2rem 2rem;
  position: relative;
  transform: translateY(16px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.auth-modal.is-open .auth-modal__box {
  transform: translateY(0);
}

.auth-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  background: none;
  border: 0.5px solid rgba(26, 21, 16, 0.15);
  color: #1A1714;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
}
.auth-modal__close:hover {
  border-color: var(--gold, #C9A96E);
}

.auth-modal__brand {
  font-family: var(--font-serif, 'Cormorant Garamond', serif);
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  color: var(--gold, #C9A96E);
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-modal__brand span {
  font-style: italic;
}

.auth-modal__title {
  font-family: var(--font-serif, 'Cormorant Garamond', serif);
  font-size: 1.75rem;
  font-weight: 500;
  color: #1A1714;
  text-align: center;
  margin-bottom: 0.4rem;
  line-height: 1.2;
}

.auth-modal__subtitle {
  font-family: var(--font-sans, 'Jost', sans-serif);
  font-size: 0.78rem;
  font-weight: 300;
  color: rgba(26, 21, 16, 0.5);
  letter-spacing: 0.04em;
  text-align: center;
  margin-bottom: 2rem;
}

/* ---- Provider Buttons ---- */

.auth-providers {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.auth-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans, 'Jost', sans-serif);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  transition: opacity 0.2s, transform 0.15s;
}
.auth-btn:hover {
  opacity: 0.9;
}
.auth-btn:active {
  transform: scale(0.99);
}
.auth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.auth-btn svg,
.auth-btn img {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Google */
.auth-btn--google {
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  box-shadow: 0 1px 2px rgba(60,64,67,0.08);
}
.auth-btn--google:hover {
  box-shadow: 0 2px 6px rgba(60,64,67,0.15);
  opacity: 1;
}

/* Apple */
.auth-btn--apple {
  background: #000;
  color: #fff;
}
.auth-btn--apple:hover {
  background: #1a1a1a;
  opacity: 1;
}

/* Loading spinner inside button */
.auth-btn__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: authSpin 0.7s linear infinite;
}
@keyframes authSpin {
  to { transform: rotate(360deg); }
}

/* ---- Divider ---- */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  color: rgba(26, 21, 16, 0.3);
  font-family: var(--font-sans, 'Jost', sans-serif);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 0.5px;
  background: rgba(26, 21, 16, 0.12);
}

/* ---- Error message ---- */

.auth-error {
  background: rgba(192, 57, 43, 0.07);
  border-left: 2px solid #C0392B;
  color: #8A3020;
  font-family: var(--font-sans, 'Jost', sans-serif);
  font-size: 0.75rem;
  padding: 0.65rem 0.75rem;
  margin-bottom: 1rem;
  display: none;
}
.auth-error.visible {
  display: block;
}

/* ---- Privacy note ---- */

.auth-note {
  font-family: var(--font-sans, 'Jost', sans-serif);
  font-size: 0.68rem;
  color: rgba(26, 21, 16, 0.38);
  text-align: center;
  line-height: 1.6;
  letter-spacing: 0.02em;
}
.auth-note a {
  color: var(--gold, #C9A96E);
  text-decoration: none;
}
.auth-note a:hover {
  text-decoration: underline;
}

.auth-provider-note {
  margin: -0.65rem 0 1.25rem;
  color: rgba(26, 21, 16, 0.45);
  font-family: var(--font-sans, 'Jost', sans-serif);
  font-size: 0.68rem;
  line-height: 1.55;
  text-align: center;
}

/* ============================================================
   NAV AUTH BUTTON & USER AVATAR
   ============================================================ */

.nav__icon--auth {
  position: relative;
}

/* User avatar circle (shown when signed in) */
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold, #C9A96E);
  color: #1A1714;
  font-family: var(--font-sans, 'Jost', sans-serif);
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
  flex-shrink: 0;
  overflow: hidden;
}
.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Dark nav variant */
.nav--prestige .user-avatar {
  border: 1px solid rgba(201, 169, 110, 0.4);
}

/* ---- User dropdown menu ---- */

.user-dropdown {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  width: 220px;
  background: #FAF7F2;
  border: 0.5px solid rgba(26, 21, 16, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.nav--prestige .user-dropdown {
  background: #1E1A14;
  border-color: rgba(201, 169, 110, 0.15);
}
.nav__icon--auth.is-open .user-dropdown {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.user-dropdown__header {
  padding: 1rem;
  border-bottom: 0.5px solid rgba(26, 21, 16, 0.08);
}
.nav--prestige .user-dropdown__header {
  border-bottom-color: rgba(201, 169, 110, 0.1);
}
.user-dropdown__name {
  font-family: var(--font-serif, 'Cormorant Garamond', serif);
  font-size: 0.95rem;
  font-weight: 500;
  color: #1A1714;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.15rem;
}
.nav--prestige .user-dropdown__name {
  color: #FAF7F2;
}
.user-dropdown__email {
  font-family: var(--font-sans, 'Jost', sans-serif);
  font-size: 0.68rem;
  color: rgba(26, 21, 16, 0.4);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav--prestige .user-dropdown__email {
  color: rgba(250, 247, 242, 0.35);
}

.user-dropdown__links {
  padding: 0.5rem 0;
}
.user-dropdown__link {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-sans, 'Jost', sans-serif);
  font-size: 0.78rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: #1A1714;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.nav--prestige .user-dropdown__link {
  color: rgba(250, 247, 242, 0.8);
}
.user-dropdown__link:hover {
  background: rgba(26, 21, 16, 0.05);
}
.nav--prestige .user-dropdown__link:hover {
  background: rgba(201, 169, 110, 0.07);
}
.user-dropdown__link--danger {
  color: rgba(192, 57, 43, 0.75);
  border-top: 0.5px solid rgba(26, 21, 16, 0.08);
  margin-top: 0.25rem;
  padding-top: 0.75rem;
}
.nav--prestige .user-dropdown__link--danger {
  border-top-color: rgba(201, 169, 110, 0.1);
  color: rgba(192, 57, 43, 0.65);
}
.user-dropdown__link--danger:hover {
  background: rgba(192, 57, 43, 0.05);
  color: #C0392B;
}

/* ============================================================
   ACCOUNT PROFILE MODAL
   ============================================================ */

.account-modal {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(26, 23, 20, 0.52);
}

.account-modal.is-open {
  display: flex;
}

.account-modal__box {
  width: min(860px, 100%);
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  background: #FAF7F2;
  border: 0.5px solid rgba(26, 21, 16, 0.12);
  box-shadow: 0 22px 70px rgba(26, 23, 20, 0.22);
  position: relative;
}

.account-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 34px;
  height: 34px;
  border: 0.5px solid rgba(26, 21, 16, 0.14);
  background: transparent;
  color: #1A1714;
  cursor: pointer;
  font-size: 1.2rem;
}

.account-modal__head {
  padding: 2rem 2rem 1rem;
  border-bottom: 0.5px solid rgba(26, 21, 16, 0.08);
}

.account-modal__eyebrow {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--gold, #C9A96E);
  margin-bottom: 0.45rem;
}

.account-modal__head h2 {
  font-family: var(--font-serif, 'Cormorant Garamond', serif);
  font-size: 2rem;
  font-weight: 300;
  color: #1A1714;
}

.account-modal__head p {
  margin-top: 0.35rem;
  color: rgba(26, 21, 16, 0.55);
  font-size: 0.82rem;
}

.account-tabs {
  display: flex;
  gap: 0;
  padding: 0 2rem;
  border-bottom: 0.5px solid rgba(26, 21, 16, 0.08);
  overflow-x: auto;
}

.account-tab {
  border: 0;
  background: transparent;
  padding: 1rem 0.95rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(26, 21, 16, 0.45);
  border-bottom: 2px solid transparent;
}

.account-tab.active {
  color: #1A1714;
  border-bottom-color: var(--gold, #C9A96E);
}

.account-status {
  display: none;
  margin: 1rem 2rem 0;
  padding: 0.75rem 1rem;
  font-size: 0.78rem;
  border-left: 2px solid var(--gold, #C9A96E);
  background: rgba(201, 169, 110, 0.09);
}

.account-status.is-visible {
  display: block;
}

.account-status--error {
  border-left-color: #8A3020;
  background: rgba(138, 48, 32, 0.08);
  color: #8A3020;
}

.account-modal__body {
  padding: 1.5rem 2rem 2rem;
}

.account-section {
  display: grid;
  gap: 1rem;
}

.account-section h3,
.account-address-form h4 {
  font-family: var(--font-serif, 'Cormorant Garamond', serif);
  font-weight: 300;
  font-size: 1.25rem;
  color: #1A1714;
}

.account-grid {
  display: grid;
  gap: 1rem;
}

.account-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-field {
  display: grid;
  gap: 0.45rem;
}

.account-field span,
.account-check span {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(26, 21, 16, 0.5);
}

.account-field input,
.account-field textarea {
  width: 100%;
  border: 0.5px solid rgba(26, 21, 16, 0.14);
  background: #fff;
  color: #1A1714;
  font: inherit;
  font-size: 0.84rem;
  padding: 0.82rem 0.95rem;
  outline: none;
}

.account-field input:disabled {
  background: rgba(26, 21, 16, 0.04);
  color: rgba(26, 21, 16, 0.45);
}

.account-check {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.account-check input {
  accent-color: #1A1714;
  margin-top: 0.1rem;
}

.account-btn {
  border: 0.5px solid rgba(26, 21, 16, 0.18);
  background: transparent;
  color: #1A1714;
  cursor: pointer;
  padding: 0.82rem 1rem;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.account-btn--primary {
  background: #1A1714;
  color: #FAF7F2;
  border-color: #1A1714;
}

.account-btn--outline {
  border-color: #1A1714;
}

.account-btn--ghost {
  border-color: transparent;
  color: rgba(26, 21, 16, 0.55);
}

.account-address-list {
  display: grid;
  gap: 0.75rem;
}

.account-address {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: 1rem;
  background: #fff;
  border: 0.5px solid rgba(26, 21, 16, 0.1);
}

.account-address__title {
  color: #1A1714;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.account-address__title span {
  margin-left: 0.45rem;
  color: var(--gold, #C9A96E);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.account-address__text {
  color: rgba(26, 21, 16, 0.58);
  font-size: 0.76rem;
  line-height: 1.55;
}

.account-address__actions {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.account-address__actions button {
  border: 0;
  background: rgba(26, 21, 16, 0.06);
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  font-size: 0.68rem;
  color: #1A1714;
}

.account-address__actions .danger {
  color: #8A3020;
}

.account-address-form {
  display: grid;
  gap: 1rem;
  margin-top: 0.8rem;
  padding-top: 1rem;
  border-top: 0.5px solid rgba(26, 21, 16, 0.1);
}

.account-form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.account-empty {
  color: rgba(26, 21, 16, 0.5);
  font-size: 0.82rem;
  line-height: 1.6;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 600px) {
  .auth-modal__box {
    padding: 2rem 1.5rem 1.5rem;
  }
  .user-dropdown {
    right: -0.5rem;
    width: 200px;
  }
  .account-modal {
    padding: 0;
  }
  .account-modal__box {
    max-height: 100vh;
    min-height: 100vh;
  }
  .account-grid--2,
  .account-address {
    grid-template-columns: 1fr;
  }
  .account-address__actions {
    flex-wrap: wrap;
  }
}

/* ============================================================
   MODAL — scrollable on small screens
   ============================================================ */

.auth-modal__box {
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(201,169,110,0.3) transparent;
}

/* ============================================================
   VIEW SWITCHING
   ============================================================ */

/* Animated title transition */
.auth-modal__title {
  transition: opacity 0.15s;
}

/* ============================================================
   FORM INPUTS
   ============================================================ */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-bottom: 1.25rem;
}

.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.auth-label {
  font-family: var(--font-sans, 'Jost', sans-serif);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(26, 21, 16, 0.5);
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input {
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(26, 21, 16, 0.2);
  color: #1A1714;
  font-family: var(--font-sans, 'Jost', sans-serif);
  font-size: 0.9rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  padding: 0.55rem 2rem 0.55rem 0;
  outline: none;
  transition: border-color 0.2s;
  border-radius: 0;
  -webkit-appearance: none;
}
.auth-input::placeholder {
  color: rgba(26, 21, 16, 0.22);
}
.auth-input:focus {
  border-bottom-color: var(--gold, #C9A96E);
}
.auth-input.is-error {
  border-bottom-color: #C0392B;
}
/* Make room for toggle button when inside wrap */
.auth-input-wrap .auth-input {
  padding-right: 2.2rem;
}

.auth-field-error {
  font-family: var(--font-sans, 'Jost', sans-serif);
  font-size: 0.68rem;
  color: #C0392B;
  letter-spacing: 0.02em;
  display: none;
}
.auth-field-error.visible {
  display: block;
}

/* Password show/hide toggle */
.password-toggle {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.2rem;
  cursor: pointer;
  color: rgba(26, 21, 16, 0.35);
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.password-toggle:hover {
  color: var(--gold, #C9A96E);
}

/* Password strength bar */
.password-strength {
  margin-top: 0.4rem;
  display: none;
}
.password-strength.visible {
  display: block;
}
.password-strength__bar {
  height: 3px;
  background: rgba(26, 21, 16, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}
.password-strength__fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s, background 0.3s;
}
.password-strength__fill--weak   { width: 33%; background: #C0392B; }
.password-strength__fill--medium { width: 66%; background: #E67E22; }
.password-strength__fill--strong { width: 100%; background: #27AE60; }
.password-strength__label {
  font-family: var(--font-sans, 'Jost', sans-serif);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: rgba(26, 21, 16, 0.45);
}

/* ============================================================
   SUBMIT BUTTON
   ============================================================ */

.auth-submit-btn {
  width: 100%;
  justify-content: center;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  padding: 0.85rem 1rem;
  background: #1A1714;
  color: #FAF7F2;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans, 'Jost', sans-serif);
  font-weight: 400;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s, opacity 0.2s;
}
.auth-submit-btn:hover {
  background: #2A2320;
}
.auth-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   FORGOT PASSWORD + VIEW SWITCH
   ============================================================ */

.auth-forgot-link {
  display: block;
  background: none;
  border: none;
  padding: 0;
  margin: 0 auto 1.5rem;
  font-family: var(--font-sans, 'Jost', sans-serif);
  font-size: 0.72rem;
  color: rgba(26, 21, 16, 0.4);
  cursor: pointer;
  letter-spacing: 0.04em;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
.auth-forgot-link:hover {
  color: var(--gold, #C9A96E);
}

.auth-switch {
  text-align: center;
  margin-top: 1.25rem;
  font-family: var(--font-sans, 'Jost', sans-serif);
  font-size: 0.75rem;
  color: rgba(26, 21, 16, 0.45);
  letter-spacing: 0.03em;
}
.auth-switch__link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #1A1714;
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.auth-switch__link:hover {
  color: var(--gold, #C9A96E);
}

/* Back link (reset view) */
.auth-back-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-sans, 'Jost', sans-serif);
  font-size: 0.72rem;
  color: rgba(26, 21, 16, 0.4);
  letter-spacing: 0.04em;
  margin-bottom: 1.5rem;
  transition: color 0.2s;
}
.auth-back-link:hover {
  color: #1A1714;
}

/* Reset success state */
.auth-success {
  background: rgba(39, 174, 96, 0.07);
  border-left: 2px solid #27AE60;
  color: #1E6B3C;
  font-family: var(--font-sans, 'Jost', sans-serif);
  font-size: 0.75rem;
  padding: 0.65rem 0.75rem;
  margin-bottom: 1rem;
  display: none;
}
.auth-success.visible {
  display: block;
}
