.auth-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.auth-modal.open {
  display: flex;
}

.auth-modal-content {
  background: #fff;
  width: 100%;
  max-width: 420px;
  border-radius: 0;
  padding: 2.5rem 2.5rem 2rem;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.auth-modal-back,
.auth-modal-close {
  position: absolute;
  top: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.auth-modal-back { left: 12px; }
.auth-modal-close { right: 12px; }

.auth-modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-modal-header {
  text-align: center;
  margin-bottom: 0.25rem;
}

.auth-modal-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
  color: #111;
}

.auth-modal-protected {
  font-size: 0.72rem;
  color: #888;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.auth-modal-protected i {
  color: #22c55e;
  font-size: 0.85rem;
}

.auth-modal-form label {
  font-size: 0.78rem;
  font-weight: 500;
  color: #333;
}

.auth-modal-form input {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid #ddd;
  border-radius: 0;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
}

.auth-modal-form input:focus {
  border-color: #111;
}

.auth-input-wrap input:-webkit-autofill,
.auth-input-wrap input:-webkit-autofill:hover,
.auth-input-wrap input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  -webkit-text-fill-color: #333;
  caret-color: #333;
}

.auth-modal-forgot {
  text-align: left;
  font-size: 0.78rem;
  color: #888;
  text-decoration: none;
}

.auth-modal-forgot:hover {
  color: #000;
}

.auth-modal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  white-space: nowrap;
}

.auth-modal-link {
  font-size: 0.75rem;
  color: #888;
  text-decoration: none;
}

.auth-modal-link:hover {
  color: #000;
}

.auth-modal-link-sep {
  font-size: 0.7rem;
  color: #ccc;
}

.auth-modal-submit {
  width: 100%;
  padding: 0.7rem;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 0;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.auth-modal-submit:hover {
  background: #333;
}

.auth-modal-submit:disabled {
  background: #ccc;
  color: #fff;
  cursor: not-allowed;
}

/* Auth two-step */
.auth-step {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.auth-input-wrap input {
  width: 100%;
  padding: 0.7rem 2.2rem 0.7rem 0.8rem;
  border: 1px solid #ddd;
  border-radius: 0;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
}

.auth-input-wrap input:focus {
  border-color: #111;
}

.auth-input-clear,
.auth-input-toggle {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  padding: 4px;
  font-size: 0.85rem;
}

.auth-input-clear {
  display: none;
}

.auth-input-clear.visible {
  display: flex;
}



.auth-modal-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: #888;
  padding: 0.25rem 0;
}

.auth-modal-divider::before,
.auth-modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #eee;
}

.auth-modal-social {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.auth-modal-social-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.auth-modal-social-btn:hover {
  background: #f5f5f5;
}

/* Location Picker Modal */
.location-picker {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100000;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.location-picker.open {
  display: flex;
}

.location-picker-content {
  background: #fff;
  width: 100%;
  max-width: 400px;
  border-radius: 0;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

.location-picker-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #eee;
  font-size: 0.95rem;
  font-weight: 600;
}

.location-picker-back {
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  padding: 0;
  font-size: 1rem;
}

.location-picker-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #eee;
  color: #888;
}

.location-picker-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.85rem;
  font-family: inherit;
  color: #333;
}

.location-picker-search input::placeholder {
  color: #bbb;
}

.location-picker-list {
  overflow-y: auto;
  padding: 0.5rem 0;
  flex: 1;
  max-height: 13rem;
}

.location-picker-item {
  padding: 0.65rem 1.25rem;
  font-size: 0.85rem;
  color: #333;
  cursor: pointer;
  transition: background 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.loc-flag {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  overflow: hidden;
}

.loc-flag img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.location-picker-item:hover {
  background: #f5f5f5;
}

.location-picker-item.selected {
  font-weight: 600;
}

.location-picker-item.selected::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  margin-left: auto;
  font-size: 0.75rem;
  color: #22c55e;
}

.auth-modal-terms {
  font-size: 0.65rem;
  color: #888;
  text-align: center;
  line-height: 1.45;
  margin: 0;
}

.auth-modal-terms a {
  color: #000;
  text-decoration: underline;
}

.auth-modal-why-location {
  font-size: 0.7rem;
  color: #888;
  text-decoration: none;
  text-align: center;
  display: block;
}

.auth-modal-why-location:hover {
  color: #000;
}

.auth-email-display {
  padding: 0.5rem 0;
  font-size: 0.85rem;
  color: #333;
  border-bottom: 1px solid #eee;
}

.auth-otp-msg {
  font-size: 0.8rem;
  color: #888;
  text-align: center;
  margin: 0;
}

.auth-otp-target {
  font-size: 0.9rem;
  font-weight: 600;
  color: #111;
  text-align: center;
  margin: 0.15rem 0;
}

.auth-otp-edit {
  font-size: 0.75rem;
  color: #888;
  text-decoration: none;
  text-align: center;
  display: block;
}

.auth-otp-edit:hover {
  color: #000;
}

.auth-otp-inputs {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.auth-otp-digit {
  width: 52px;
  height: 52px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  border: 1px solid #ddd;
  outline: none;
  font-family: inherit;
}

.auth-otp-digit:focus {
  border-color: #111;
}

.auth-otp-digit:-webkit-autofill,
.auth-otp-digit:-webkit-autofill:hover,
.auth-otp-digit:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  -webkit-text-fill-color: #333;
  caret-color: #333;
}

.auth-otp-footer {
  text-align: center;
  font-size: 0.75rem;
  color: #888;
}

.auth-modal-location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: #333;
  cursor: pointer;
  padding: 0.3rem 0;
}

.auth-modal-location-value {
  max-width: 150px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: #333;
}
