/* =========================================================
   AUTH-MODAL — Sistema OTP Frictionless
   Estados: CPF → OTP | Cadastro → Sucesso
   ========================================================= */

/* Overlay */
.auth-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: amFadeIn .25s ease;
}
.auth-modal-overlay.active { display: flex; }

@keyframes amFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes amSlideUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }

/* Container */
.auth-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  width: 100%;
  max-width: 400px;
  overflow: hidden;
  animation: amSlideUp .3s ease;
}

/* Header */
.auth-modal-header {
  background: linear-gradient(135deg, #e75480 0%, #c43060 100%);
  color: #fff;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.auth-modal-logo { font-weight: 600; font-size: 15px; letter-spacing: .02em; }
.auth-modal-close {
  background: rgba(255,255,255,.2);
  border: none; cursor: pointer;
  color: #fff; font-size: 22px; line-height: 1;
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.auth-modal-close:hover { background: rgba(255,255,255,.35); }

/* Body */
.auth-modal-body { padding: 28px 28px 32px; }

/* Step */
.auth-step { animation: amSlideUp .2s ease; }
.auth-title { font-size: 20px; font-weight: 700; color: #1a1a1a; margin-bottom: 6px; }
.auth-sub   { font-size: 14px; color: #666; line-height: 1.5; margin-bottom: 24px; }
.auth-sub strong { color: #1a1a1a; }

/* Field */
.auth-field { margin-bottom: 18px; }
.auth-field label {
  display: block; font-size: 12px; font-weight: 600;
  color: #555; letter-spacing: .04em; text-transform: uppercase;
  margin-bottom: 6px;
}
.auth-field input {
  width: 100%; padding: 13px 14px;
  border: 1.5px solid #ddd; border-radius: 10px;
  font-size: 16px; color: #1a1a1a; outline: none;
  transition: border-color .15s, box-shadow .15s;
  background: #fafafa;
}
.auth-field input:focus {
  border-color: #e75480;
  box-shadow: 0 0 0 3px rgba(231,84,128,.12);
  background: #fff;
}

/* OTP input — centro e grande */
.otp-field input {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 10px;
  padding: 16px;
}

/* Botão principal */
.auth-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #e75480 0%, #c43060 100%);
  color: #fff; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 4px;
}
.auth-btn:hover:not(:disabled) { opacity: .9; transform: translateY(-1px); }
.auth-btn:active:not(:disabled) { transform: translateY(0); }
.auth-btn:disabled { opacity: .55; cursor: not-allowed; }

/* Spinner */
.auth-spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: amSpin .7s linear infinite;
}
@keyframes amSpin { to { transform: rotate(360deg); } }

/* Mensagem de feedback */
.auth-msg {
  display: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}
.auth-msg-erro   { background: #fff0f3; color: #c0392b; border: 1px solid #f5c6cb; }
.auth-msg-sucesso { background: #e8f8ee; color: #1a7a40; border: 1px solid #c3e6cb; }

/* Botão voltar */
.auth-back-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #888;
  font-size: 13px;
  cursor: pointer;
  padding: 10px;
  margin-top: 8px;
  border-radius: 8px;
  transition: color .15s, background .15s;
}
.auth-back-btn:hover { color: #e75480; background: #fff0f5; }

/* ─── USER MENU (header logado) ──────────────────────────────────── */

.btn-auth-header {
  background: none; border: 1px solid #ddd;
  padding: 7px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  color: #333; transition: all .15s;
}
.btn-auth-header:hover { border-color: #e75480; color: #e75480; }
.btn-auth-header.logado { border-color: #e75480; color: #e75480; display: flex; align-items: center; gap: 6px; }

.user-menu-wrapper { position: relative; }
.user-chevron { font-size: 9px; opacity: .7; }

.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: #fff; border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14);
  border: 1px solid #f0f0f0;
  min-width: 200px; z-index: 400;
  opacity: 0; transform: translateY(-8px);
  pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.user-menu-wrapper.open .user-dropdown {
  opacity: 1; transform: translateY(0); pointer-events: auto;
}
.user-dropdown-header { padding: 14px 16px 10px; border-bottom: 1px solid #f0f0f0; }
.user-dropdown-name { font-weight: 600; font-size: 14px; color: #1a1a1a; }
.user-dropdown-sub  { font-size: 11px; color: #999; margin-top: 2px; }
.user-dropdown-item {
  width: 100%; background: none; border: none;
  padding: 11px 16px; text-align: left;
  font-size: 13px; color: #333; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: background .1s;
}
.user-dropdown-item:hover { background: #f8f8f8; }
.user-dropdown-item.danger { color: #c0392b; }
.user-dropdown-item.danger:hover { background: #fff0f0; }
.user-dropdown-divider { height: 1px; background: #f0f0f0; margin: 4px 0; }
.item-icon { font-size: 15px; }

/* ─── MODAL MEUS PEDIDOS ─────────────────────────────────────────── */

.pedidos-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 500;
  align-items: center; justify-content: center; padding: 20px;
}
.pedidos-modal-overlay.open { display: flex; }
.pedidos-modal {
  background: #fff; border-radius: 16px;
  width: 100%; max-width: 480px; max-height: 80vh;
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.pedidos-modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid #f0f0f0;
  display: flex; align-items: center; justify-content: space-between;
}
.pedidos-modal-title { font-weight: 700; font-size: 16px; }
.pedidos-modal-close {
  background: #f0f0f0; border: none; cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
}
.pedidos-modal-body { overflow-y: auto; padding: 16px; flex: 1; }
.pedidos-vazio { text-align: center; padding: 40px 20px; color: #999; font-size: 14px; }

.pedido-card {
  border: 1px solid #f0f0f0; border-radius: 10px;
  padding: 14px 16px; margin-bottom: 10px; background: #fafafa;
}
.pedido-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.pedido-numero { font-weight: 700; font-size: 14px; }
.pedido-data   { font-size: 12px; color: #999; margin-top: 2px; }
.pedido-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.pedido-itens  { font-size: 13px; color: #555; margin-bottom: 8px; }
.pedido-footer { display: flex; justify-content: space-between; align-items: center; }
.pedido-valor  { font-weight: 700; font-size: 14px; color: #1a1a1a; }

.badge-status {
  font-size: 11px; font-weight: 600; padding: 3px 8px;
  border-radius: 6px; white-space: nowrap;
}
.badge-pago      { background: #e8f8ee; color: #1a7a40; }
.badge-pendente  { background: #fff8e1; color: #a0620a; }
.badge-cancelado { background: #fff0f0; color: #c0392b; }
.badge-entregue  { background: #e3f2fd; color: #1565c0; }
.badge-retirada  { background: #f3e5f5; color: #6a1b9a; }
.badge-transito  { background: #e8f5e9; color: #2e7d32; }
