/* Auth modal – login/signup (Add to Cart / Checkout) */
.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-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.auth-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.auth-modal-box {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  position: relative;
  transform: scale(0.95);
  transition: transform 0.25s ease;
}
.auth-modal-overlay.show .auth-modal-box {
  transform: scale(1);
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: none;
  background: #f0f0f0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.auth-modal-close:hover {
  background: #e0e0e0;
  color: #1a1a1a;
}

.auth-modal-inner {
  padding: 28px 32px 32px;
}

.auth-modal-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid #eee;
}
.auth-modal-tab {
  padding: 10px 16px;
  border: none;
  background: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.auth-modal-tab:hover { color: #333; }
.auth-modal-tab.active {
  color: #1a1a1a;
  border-bottom-color: #D4A017;
}

.auth-modal-view { display: none; }
.auth-modal-view.active { display: block; }

.auth-modal .form-group {
  margin-bottom: 18px;
}
.auth-modal .form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}
.auth-modal .form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.auth-modal .form-group input:focus {
  outline: none;
  border-color: #D4A017;
}
.auth-modal .form-group .input-wrap {
  position: relative;
}
.auth-modal .form-group .input-wrap input {
  padding-right: 44px;
}
.auth-modal .pwd-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px;
  color: #666;
  font-size: 1.1rem;
}
.auth-modal .pwd-toggle:hover { color: #333; }

.auth-modal-forgot {
  text-align: right;
  margin-top: -8px;
  margin-bottom: 20px;
}
.auth-modal-forgot a {
  font-size: 0.88rem;
  color: #003F87;
  text-decoration: none;
}
.auth-modal-forgot a:hover { text-decoration: underline; }

.auth-modal-btn {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  text-transform: uppercase;
}
.auth-modal-btn-primary {
  background: #e85d04;
  color: #fff;
}
.auth-modal-btn-primary:hover {
  background: #d35400;
}
.auth-modal-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.auth-modal-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: #666;
}
.auth-modal-switch a {
  color: #003F87;
  font-weight: 600;
  text-decoration: none;
}
.auth-modal-switch a:hover { text-decoration: underline; }

.auth-modal-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 20px;
  color: #999;
  font-size: 0.85rem;
}
.auth-modal-divider::before,
.auth-modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}

.auth-modal-social {
  display: flex;
  gap: 12px;
}
.auth-modal-social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.auth-modal-social-btn:hover {
  border-color: #ccc;
  background: #f9f9f9;
}
.auth-modal-social-btn svg {
  width: 20px;
  height: 20px;
}

.auth-modal-error {
  background: #fee;
  color: #c00;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.88rem;
  margin-bottom: 16px;
  display: none;
}
.auth-modal-error.show { display: block; }
