/* =============================================
   DIGITECH ACCESSORIES HUB — Auth & Account CSS
   ============================================= */

/* ===== AUTH MODAL OVERLAY ===== */
.auth-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65); z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.auth-modal {
  background: var(--surface); border-radius: 16px;
  width: 100%; max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  overflow: hidden;
  animation: authSlideUp .3s ease;
}
@keyframes authSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ===== AUTH HEADER ===== */
.auth-header {
  background: var(--blue); padding: 24px 28px;
  display: flex; justify-content: space-between; align-items: center;
}
.auth-header-left { display: flex; align-items: center; gap: 12px; }
.auth-header-icon {
  background: var(--red); color: #fff;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.auth-header-title { color: #fff; font-size: 16px; font-weight: 800; line-height: 1.3; }
.auth-header-sub   { color: rgba(255,255,255,.65); font-size: 12px; margin-top: 2px; }
.auth-close {
  background: rgba(255,255,255,.2); border: none; color: #fff;
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; font-size: 16px; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.auth-close:hover { background: rgba(255,255,255,.35); }

/* ===== AUTH TABS ===== */
.auth-tabs {
  display: flex; border-bottom: 2px solid var(--border);
  background: var(--surface2);
}
.auth-tab {
  flex: 1; padding: 13px; text-align: center;
  font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; border: none; background: none; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: all .2s;
}
.auth-tab.active { color: var(--blue); border-bottom-color: var(--blue); background: var(--surface); }

/* ===== AUTH BODY ===== */
.auth-body { padding: 24px 28px; }

.auth-form-group { margin-bottom: 16px; }
.auth-label {
  display: block; font-size: 10px; color: var(--muted);
  letter-spacing: 1.5px; text-transform: uppercase;
  font-weight: 700; margin-bottom: 6px;
}
.auth-input {
  width: 100%; background: var(--surface2);
  border: 1.5px solid var(--border); color: var(--text);
  padding: 11px 14px; font-family: inherit; font-size: 14px;
  outline: none; border-radius: 8px; transition: border-color .2s;
}
.auth-input:focus { border-color: var(--blue); }
.auth-input.error { border-color: var(--red); }
.auth-input-wrap { position: relative; }
.auth-input-wrap .auth-input { padding-right: 44px; }
.toggle-pw {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 16px;
  color: var(--muted); line-height: 1;
}
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-error {
  background: var(--red-light); border: 1px solid var(--red);
  color: var(--red); border-radius: 7px; padding: 10px 14px;
  font-size: 13px; margin-bottom: 14px; font-weight: 600;
}
.auth-success {
  background: var(--green-light); border: 1px solid var(--green);
  color: var(--green); border-radius: 7px; padding: 10px 14px;
  font-size: 13px; margin-bottom: 14px; font-weight: 600;
}
.auth-submit {
  width: 100%; background: var(--blue); color: #fff;
  border: none; padding: 13px; font-family: inherit;
  font-size: 14px; font-weight: 800; cursor: pointer;
  border-radius: 8px; transition: background .15s; margin-top: 4px;
}
.auth-submit:hover { background: var(--blue-dark); }
.auth-submit:disabled { opacity: .6; cursor: not-allowed; }
.auth-divider {
  text-align: center; color: var(--muted); font-size: 12px;
  margin: 14px 0; position: relative;
}
.auth-divider::before, .auth-divider::after {
  content: ''; position: absolute; top: 50%;
  width: 42%; height: 1px; background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }
.auth-switch {
  text-align: center; font-size: 13px; color: var(--muted); margin-top: 14px;
}
.auth-switch-link {
  color: var(--blue); font-weight: 700; cursor: pointer; text-decoration: underline;
}
.auth-switch-link:hover { color: var(--blue-dark); }

/* ===== ADDRESS SECTION IN REGISTER ===== */
.auth-section-title {
  font-size: 11px; color: var(--blue); letter-spacing: 1.5px;
  text-transform: uppercase; font-weight: 800;
  margin: 18px 0 12px; padding-top: 14px;
  border-top: 1.5px solid var(--border);
}
.district-select {
  width: 100%; background: var(--surface2);
  border: 1.5px solid var(--border); color: var(--text);
  padding: 11px 14px; font-family: inherit; font-size: 14px;
  outline: none; border-radius: 8px; transition: border-color .2s;
}
.district-select:focus { border-color: var(--blue); }

/* ===== NAV USER BUTTON ===== */
.user-nav-btn {
  background: rgba(255,255,255,.15); color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  padding: 7px 14px; border-radius: 20px;
  font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 7px;
  transition: all .2s; margin-left: 4px;
}
.user-nav-btn:hover { background: rgba(255,255,255,.25); }
.user-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; flex-shrink: 0;
}

/* ===== USER DROPDOWN ===== */
.user-dropdown-wrap { position: relative; }
.user-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 12px; min-width: 220px;
  box-shadow: 0 8px 32px rgba(0,0,0,.15); z-index: 400;
  overflow: hidden; animation: dropIn .2s ease;
}
@keyframes dropIn {
  from { transform: translateY(-8px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.user-dropdown-header {
  padding: 14px 16px; background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.user-dropdown-name  { font-weight: 800; font-size: 14px; color: var(--text); }
.user-dropdown-email { font-size: 11px; color: var(--muted); margin-top: 2px; }
.user-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; cursor: pointer; font-size: 13px;
  color: var(--text); transition: background .15s; border: none;
  background: none; width: 100%; text-align: left; font-family: inherit;
}
.user-dropdown-item:hover { background: var(--surface2); }
.user-dropdown-item.danger { color: var(--red); }
.user-dropdown-item.danger:hover { background: var(--red-light); }
.user-dropdown-icon { font-size: 16px; width: 20px; text-align: center; }
.user-dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ===== ACCOUNT PAGE ===== */
.account-wrap { max-width: 860px; margin: 0 auto; padding: 48px 24px; }
.account-header { display: flex; align-items: center; gap: 18px; margin-bottom: 36px; }
.account-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 900; flex-shrink: 0;
  border: 3px solid var(--blue-light);
}
.account-name  { font-size: 22px; font-weight: 900; color: var(--text); }
.account-email { font-size: 13px; color: var(--muted); margin-top: 2px; }
.account-since { font-size: 11px; color: var(--muted); margin-top: 4px; }

.account-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 28px; }
.account-tab {
  padding: 10px 20px; font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; border: none; background: none; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all .2s;
}
.account-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

/* ===== ADDRESS CARDS ===== */
.addresses-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 20px; }
.address-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 18px; position: relative;
  transition: border-color .2s;
}
.address-card.default { border-color: var(--blue); background: var(--blue-light); }
.address-card-label {
  font-size: 11px; font-weight: 800; color: var(--blue);
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.default-badge {
  background: var(--blue); color: #fff;
  font-size: 9px; padding: 2px 7px; border-radius: 10px; font-weight: 700;
}
.address-card-text { font-size: 13px; color: var(--text); line-height: 1.8; }
.address-card-actions { display: flex; gap: 8px; margin-top: 12px; }
.addr-btn {
  font-family: inherit; font-size: 11px; font-weight: 700;
  padding: 5px 12px; border-radius: 5px; cursor: pointer; border: none; transition: all .2s;
}
.addr-btn.set-default { background: var(--blue-light); color: var(--blue); }
.addr-btn.set-default:hover { background: var(--blue); color: #fff; }
.addr-btn.delete { background: var(--red-light); color: var(--red); }
.addr-btn.delete:hover { background: var(--red); color: #fff; }

.add-address-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface); border: 1.5px dashed var(--border);
  border-radius: 12px; padding: 22px; cursor: pointer;
  font-size: 13px; font-weight: 700; color: var(--muted);
  transition: all .2s; width: 100%;
}
.add-address-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }

/* ===== CHECKOUT ADDRESS PICKER ===== */
.addr-picker { margin-bottom: 16px; }
.addr-picker-title {
  font-size: 10px; color: var(--muted); letter-spacing: 1.5px;
  text-transform: uppercase; font-weight: 700; margin-bottom: 10px;
}
.addr-options { display: flex; flex-direction: column; gap: 8px; }
.addr-option {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 9px; padding: 12px 14px; cursor: pointer; transition: all .2s;
}
.addr-option.selected { border-color: var(--blue); background: var(--blue-light); }
.addr-option-radio {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border); flex-shrink: 0; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.addr-option.selected .addr-option-radio {
  border-color: var(--blue); background: var(--blue);
}
.addr-option.selected .addr-option-radio::after {
  content: ''; width: 6px; height: 6px;
  background: #fff; border-radius: 50%;
}
.addr-option-info { flex: 1; min-width: 0; }
.addr-option-label { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.addr-option-text  { font-size: 12px; color: var(--muted); line-height: 1.6; }
.addr-add-new {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--blue); font-weight: 700;
  cursor: pointer; padding: 8px 0; border: none;
  background: none; font-family: inherit;
}
.addr-add-new:hover { text-decoration: underline; }

/* ===== PROFILE FORM ===== */
.profile-form {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 24px; max-width: 520px;
}
.profile-section-title {
  font-size: 11px; color: var(--blue); letter-spacing: 1.5px;
  text-transform: uppercase; font-weight: 800;
  margin: 20px 0 12px; padding-top: 16px;
  border-top: 1.5px solid var(--border);
}
.profile-section-title:first-child { margin-top: 0; padding-top: 0; border-top: none; }

/* ===== ORDER HISTORY ===== */
.order-history { display: flex; flex-direction: column; gap: 14px; }
.order-hist-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.order-hist-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; background: var(--surface2);
  border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 8px;
}
.order-hist-ref   { font-weight: 800; font-size: 14px; color: var(--text); }
.order-hist-date  { font-size: 12px; color: var(--muted); }
.order-hist-body  { padding: 14px 18px; }
.order-hist-items { font-size: 12px; color: var(--muted); line-height: 1.9; margin-bottom: 10px; }
.order-hist-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.order-hist-total  { font-size: 15px; font-weight: 900; color: var(--red); }
.order-hist-pay    { font-size: 11px; color: var(--muted); font-weight: 600; }

/* ===== GUEST PROMPT (shown when not logged in & adding to cart) ===== */
.guest-prompt {
  background: var(--blue-light); border: 1.5px solid rgba(38,28,193,.2);
  border-radius: 10px; padding: 16px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 14px;
}
.guest-prompt-icon { font-size: 28px; flex-shrink: 0; }
.guest-prompt-text { flex: 1; }
.guest-prompt-title { font-weight: 800; font-size: 14px; color: var(--blue); margin-bottom: 3px; }
.guest-prompt-sub   { font-size: 12px; color: var(--muted); }
.guest-prompt-btns  { display: flex; gap: 8px; flex-shrink: 0; }
.guest-login-btn {
  background: var(--blue); color: #fff; border: none;
  padding: 8px 16px; border-radius: 6px; font-family: inherit;
  font-size: 12px; font-weight: 700; cursor: pointer; transition: background .15s;
  white-space: nowrap;
}
.guest-login-btn:hover { background: var(--blue-dark); }
.guest-register-btn {
  background: transparent; color: var(--blue);
  border: 1.5px solid var(--blue); padding: 8px 14px;
  border-radius: 6px; font-family: inherit; font-size: 12px;
  font-weight: 700; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.guest-register-btn:hover { background: var(--blue); color: #fff; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .auth-body   { padding: 18px 18px; }
  .auth-header { padding: 18px 18px; }
  .auth-row    { grid-template-columns: 1fr; }
  .addresses-grid { grid-template-columns: 1fr; }
  .account-wrap { padding: 32px 14px; }
  .guest-prompt { flex-direction: column; }
  .guest-prompt-btns { width: 100%; }
  .guest-login-btn, .guest-register-btn { flex: 1; text-align: center; }
}
