/* ══════════════════════════════════════════════
   AUTH & PROFILE STYLES — Era21 Designs
══════════════════════════════════════════════ */

/* ── Auth Modal ─────────────────────────────── */
.auth-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 700;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .4s;
  padding: 1rem;
}
.auth-overlay.show { opacity: 1; pointer-events: all; }

.auth-box {
  background: var(--d2);
  border: 1px solid rgba(200,169,126,.18);
  width: 100%; max-width: 420px;
  position: relative;
  transform: translateY(20px);
  transition: transform .4s var(--ease-s);
  overflow: hidden;
}
.auth-overlay.show .auth-box { transform: none; }

.auth-header {
  background: linear-gradient(135deg, var(--d3), var(--d1));
  padding: 2rem 2rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(200,169,126,.1);
}
.auth-logo {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  margin-bottom: 1rem;
}
.auth-logo img { height: 36px; width: auto; }
.auth-logo span {
  font-family: var(--cg);
  font-size: 1.3rem; font-weight: 500; color: var(--gold);
}
.auth-tabs {
  display: flex; border-bottom: 1px solid rgba(200,169,126,.12);
}
.auth-tab {
  flex: 1; background: none; border: none;
  padding: .9rem; font-family: var(--mt); font-size: .78rem;
  font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all .3s;
}
.auth-tab.on { color: var(--gold); border-bottom-color: var(--gold); }

.auth-body { padding: 1.8rem 2rem 2rem; }

/* Google btn */
.btn-google {
  width: 100%; display: flex; align-items: center; justify-content: center;
  gap: .8rem; padding: .85rem;
  background: var(--white); color: #333;
  border: none; font-family: var(--mt); font-size: .82rem; font-weight: 500;
  cursor: pointer; transition: all .3s; margin-bottom: 1.2rem;
}
.btn-google:hover { background: #f5f5f5; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.btn-google img { width: 20px; height: 20px; }

.auth-divider {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.2rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px;
  background: rgba(255,255,255,.08);
}
.auth-divider span {
  font-size: .7rem; color: var(--muted); white-space: nowrap;
}

.auth-field { margin-bottom: .9rem; }
.auth-field label {
  display: block; font-size: .65rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted); margin-bottom: .4rem;
}
.auth-field input {
  width: 100%; background: var(--black);
  border: 1px solid rgba(255,255,255,.07); color: var(--ivory);
  padding: .8rem 1rem; font-family: var(--mt); font-size: .88rem;
  font-weight: 300; outline: none; transition: border-color .3s;
}
.auth-field input:focus { border-color: rgba(200,169,126,.5); }

.auth-field .pass-wrap { position: relative; }
.auth-field .pass-wrap input { padding-right: 2.5rem; }
.pass-toggle {
  position: absolute; right: .8rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted); cursor: pointer; font-size: .9rem;
}

.auth-forgot {
  text-align: right; margin-top: -.5rem; margin-bottom: .9rem;
}
.auth-forgot a {
  font-size: .72rem; color: var(--gold); transition: opacity .3s;
}
.auth-forgot a:hover { opacity: .8; }

.auth-phone-row { display: flex; gap: .5rem; }
.auth-phone-row .country-code {
  width: 80px; flex-shrink: 0;
  background: var(--black); border: 1px solid rgba(255,255,255,.07);
  color: var(--ivory); padding: .8rem .6rem;
  font-family: var(--mt); font-size: .88rem; outline: none;
  -webkit-appearance: none;
}
.auth-phone-row input { flex: 1; }

.btn-otp {
  width: 100%; background: rgba(200,169,126,.1);
  border: 1px solid rgba(200,169,126,.3); color: var(--gold);
  padding: .8rem; font-family: var(--mt); font-size: .75rem;
  letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
  transition: all .3s; margin-top: .5rem;
}
.btn-otp:hover { background: rgba(200,169,126,.18); }

.auth-submit {
  width: 100%; margin-top: .3rem;
}
.auth-switch {
  text-align: center; margin-top: 1rem;
  font-size: .78rem; color: var(--muted);
}
.auth-switch a { color: var(--gold); cursor: pointer; }

.auth-close {
  position: absolute; top: .8rem; right: .8rem;
  background: none; border: none; color: var(--muted);
  font-size: 1.1rem; cursor: pointer; z-index: 1;
  transition: color .3s;
}
.auth-close:hover { color: var(--ivory); }

/* ── Navbar User Button ─────────────────────── */
.nav-login-btn {
  display: flex; align-items: center; gap: .5rem;
  border: 1px solid rgba(200,169,126,.35); color: var(--gold);
  padding: .45rem 1.1rem; font-family: var(--mt);
  font-size: .65rem; letter-spacing: .15em; text-transform: uppercase;
  cursor: pointer; transition: all .3s; background: none;
  white-space: nowrap;
}
.nav-login-btn:hover { background: var(--gold); color: var(--black); }

.nav-user-wrap { position: relative; }
.nav-user-btn {
  display: flex; align-items: center; gap: .5rem;
  background: none; border: none; cursor: pointer;
}
.nav-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gold); display: flex; align-items: center;
  justify-content: center; font-family: var(--cg);
  font-size: 1rem; font-weight: 500; color: var(--black);
  overflow: hidden; border: 2px solid rgba(200,169,126,.4);
}
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }
.nav-user-name {
  font-size: .65rem; letter-spacing: .1em; color: var(--ivory);
  max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.nav-user-dropdown {
  position: absolute; top: calc(100% + .8rem); right: 0;
  background: var(--d2); border: 1px solid rgba(200,169,126,.12);
  min-width: 180px; z-index: 200;
  transform: translateY(-8px); opacity: 0; pointer-events: none;
  transition: all .3s;
}
.nav-user-wrap:hover .nav-user-dropdown,
.nav-user-dropdown.show { transform: none; opacity: 1; pointer-events: all; }

.nav-user-dropdown a, .nav-user-dropdown button {
  display: flex; align-items: center; gap: .7rem;
  padding: .8rem 1.2rem; font-size: .78rem; font-weight: 300;
  color: var(--ivory); border: none; background: none;
  width: 100%; text-align: left; cursor: pointer;
  transition: background .2s; border-bottom: 1px solid rgba(255,255,255,.04);
}
.nav-user-dropdown a:hover, .nav-user-dropdown button:hover {
  background: rgba(200,169,126,.08); color: var(--gold);
}
.nav-user-dropdown i { color: var(--gold); width: 16px; text-align: center; }

/* ── Profile Page ───────────────────────────── */
.profile-hero {
  background: var(--d2);
  padding: 8rem 5% 3rem;
  border-bottom: 1px solid rgba(200,169,126,.1);
}
.profile-hero-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 2rem;
}
.profile-avatar-big {
  width: 90px; height: 90px; border-radius: 50%;
  background: var(--gold); display: flex; align-items: center;
  justify-content: center; font-family: var(--cg); font-size: 2.5rem;
  color: var(--black); font-weight: 600; flex-shrink: 0;
  overflow: hidden; border: 3px solid rgba(200,169,126,.3);
  position: relative; cursor: pointer;
}
.profile-avatar-big img { width: 100%; height: 100%; object-fit: cover; }
.avatar-edit-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .3s; border-radius: 50%;
  font-size: .7rem; color: var(--gold); flex-direction: column; gap: .2rem;
}
.profile-avatar-big:hover .avatar-edit-overlay { opacity: 1; }
#avatarUpload { display: none; }

.profile-info h2 {
  font-family: var(--cg); font-size: 1.8rem; font-weight: 400;
  color: var(--ivory); margin-bottom: .3rem;
}
.profile-info p { font-size: .85rem; color: var(--muted); }

.profile-main {
  max-width: 1100px; margin: 0 auto;
  padding: 2.5rem 5%; display: grid;
  grid-template-columns: 220px 1fr; gap: 2rem;
}

/* Sidebar */
.profile-sidebar { }
.profile-nav { list-style: none; }
.profile-nav li { }
.profile-nav a {
  display: flex; align-items: center; gap: .8rem;
  padding: .85rem 1rem; font-size: .82rem; font-weight: 300;
  color: var(--muted); transition: all .3s; border-left: 2px solid transparent;
}
.profile-nav a:hover, .profile-nav a.on {
  color: var(--gold); border-left-color: var(--gold);
  background: rgba(200,169,126,.05);
}
.profile-nav i { width: 16px; text-align: center; }

/* Profile panels */
.profile-panel { display: none; }
.profile-panel.on { display: block; }

.panel-title {
  font-family: var(--cg); font-size: 1.5rem; font-weight: 400;
  color: var(--ivory); margin-bottom: .3rem; padding-bottom: 1rem;
  border-bottom: 1px solid rgba(200,169,126,.1);
}

/* Edit form */
.profile-form { max-width: 560px; margin-top: 1.5rem; }
.pf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pf-field { margin-bottom: 1.1rem; }
.pf-field label {
  display: block; font-size: .65rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted); margin-bottom: .4rem;
}
.pf-field input, .pf-field select {
  width: 100%; background: var(--d2);
  border: 1px solid rgba(255,255,255,.07); color: var(--ivory);
  padding: .8rem 1rem; font-family: var(--mt); font-size: .88rem;
  font-weight: 300; outline: none; transition: border-color .3s;
}
.pf-field input:focus { border-color: rgba(200,169,126,.4); }

/* Estimate history */
.est-history { margin-top: 1.5rem; }
.est-card {
  background: var(--d2); border: 1px solid rgba(200,169,126,.08);
  padding: 1.2rem 1.5rem; margin-bottom: 1rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem; transition: border-color .3s;
}
.est-card:hover { border-color: rgba(200,169,126,.2); }
.est-card-info h5 {
  font-family: var(--cg); font-size: 1rem; font-weight: 400;
  color: var(--ivory); margin-bottom: .25rem;
}
.est-card-info span { font-size: .75rem; color: var(--muted); }
.est-card-amount {
  font-family: var(--cg); font-size: 1.4rem; color: var(--gold); font-weight: 500;
}

/* Wishlist */
.wishlist-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.2rem; margin-top: 1.5rem;
}
.wl-item {
  background: var(--d2); overflow: hidden; position: relative;
}
.wl-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.wl-item-info { padding: .8rem 1rem 1rem; }
.wl-item-info h5 {
  font-family: var(--cg); font-size: .95rem; color: var(--ivory); margin-bottom: .3rem;
}
.wl-item-info p { font-size: .78rem; color: var(--gold); }
.wl-remove {
  position: absolute; top: .5rem; right: .5rem;
  background: rgba(7,7,7,.8); border: none; color: var(--muted);
  width: 28px; height: 28px; font-size: .8rem; cursor: pointer;
  transition: color .3s;
}
.wl-remove:hover { color: #e74c3c; }

/* Empty state */
.empty-state {
  text-align: center; padding: 4rem 2rem;
  color: var(--muted);
}
.empty-state i {
  font-size: 2.5rem; color: rgba(200,169,126,.2); display: block; margin-bottom: 1rem;
}
.empty-state h4 { font-family: var(--cg); font-size: 1.2rem; color: var(--ivory-2); margin-bottom: .5rem; }
.empty-state p { font-size: .85rem; line-height: 1.7; }

/* Auth page for login required */
.auth-required {
  min-height: 60vh; display: flex; align-items: center;
  justify-content: center; flex-direction: column; text-align: center; gap: 1.5rem;
}
.auth-required i { font-size: 3rem; color: rgba(200,169,126,.3); }
.auth-required h3 { font-family: var(--cg); font-size: 1.6rem; color: var(--ivory); }
.auth-required p { color: var(--muted); font-size: .88rem; max-width: 360px; }

/* Toasts */
.auth-toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--d2); border-left: 3px solid var(--gold);
  color: var(--ivory); padding: .85rem 1.8rem; font-size: .85rem;
  z-index: 999; transition: transform .4s var(--ease-s); white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.auth-toast.show { transform: translateX(-50%) translateY(0); }

@media(max-width:768px) {
  .profile-main { grid-template-columns: 1fr; }
  .profile-sidebar { display: flex; overflow-x: auto; gap: .3rem; padding-bottom: .5rem; }
  .profile-nav { display: flex; list-style: none; }
  .profile-nav a { border-left: none; border-bottom: 2px solid transparent; white-space: nowrap; }
  .profile-nav a.on { border-bottom-color: var(--gold); border-left: none; }
  .pf-row { grid-template-columns: 1fr; }
}
