/* ══════════════════════════════════════════
 *  Promo Italia Portal - Styles
 *  Gloss Express © 2026
 * ══════════════════════════════════════════ */

:root {
  --gold: #C8A45C;
  --gold-light: #E8D5A3;
  --gold-dark: #A07D3A;
  --charcoal: #1A1A1A;
  --warm-bg: #FAF7F2;
  --warm-card: #FFFFFF;
  --warm-border: #E8E2D8;
  --text-primary: #2C2520;
  --text-secondary: #7A6F63;
  --text-muted: #A89E93;
  --success: #4A8C5C;
  --success-bg: #EDF7EF;
  --error: #C44B4B;
  --error-bg: #FDF0F0;
  --info-bg: #F0F4FD;
  --info: #4A6FA5;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
}

/* ── Reset (só para o portal) ── */
.portal-container * { margin: 0; padding: 0; box-sizing: border-box; }

.portal-container {
  font-family: 'DM Sans', sans-serif;
  color: var(--text-primary);
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
.portal-header {
  text-align: center;
  margin-bottom: 32px;
  animation: portalFadeDown 0.6s ease;
}

.portal-header .brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.portal-header h1 {
  font-family: 'DM Serif Display', serif;
  font-size: 28px;
  color: var(--charcoal);
  line-height: 1.2;
}

.portal-header p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 6px;
}

/* ── Cards ── */
.card {
  background: var(--warm-card);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  animation: portalFadeUp 0.5s ease;
}

.card + .card { margin-top: 16px; }

.card-title {
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
  color: var(--charcoal);
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ── Forms ── */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--warm-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-primary);
  background: var(--warm-bg);
  transition: all 0.2s ease;
  outline: none;
}

.form-group input:focus {
  border-color: var(--gold);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(200, 164, 92, 0.15);
}

.form-group input::placeholder { color: var(--text-muted); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #fff;
  box-shadow: 0 2px 8px rgba(200, 164, 92, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(200, 164, 92, 0.45);
}

.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-danger-ghost {
  background: transparent;
  color: var(--error);
  font-size: 13px;
  padding: 10px;
  margin-top: 24px;
}

.btn-danger-ghost:hover { background: var(--error-bg); }

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--warm-bg);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 10px 8px;
  border: none;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn.active {
  background: #fff;
  color: var(--charcoal);
  box-shadow: var(--shadow-sm);
}

.tab-btn:hover:not(.active) { color: var(--text-secondary); }

.tab-content { display: none; }
.tab-content.active { display: block; animation: portalFadeUp 0.3s ease; }

/* ── User Welcome ── */
.user-welcome {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #F9F5ED, #FFF8EC);
  border: 1px solid var(--gold-light);
  border-radius: var(--radius);
  margin-bottom: 20px;
  animation: portalFadeUp 0.4s ease;
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.user-info h3 { font-size: 15px; font-weight: 600; color: var(--charcoal); }
.user-info p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Code Cards ── */
.code-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--warm-bg);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.code-item:hover { border-color: var(--gold-light); }

.code-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.code-value {
  font-size: 18px;
  font-weight: 700;
  font-family: 'DM Sans', monospace;
  color: var(--charcoal);
  letter-spacing: 1.5px;
}

.code-number { text-align: right; }
.code-number .code-label { margin-bottom: 2px; }

.code-number span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 20px;
  min-width: 60px;
}

/* ── Code Sections ── */
.codes-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 8px 4px 4px;
  margin-top: 8px;
  border-top: 1px solid var(--warm-border);
}

.codes-section-title:first-child { margin-top: 0; border-top: none; }

.codes-section-title--bonus { color: var(--italian-red); }
.codes-section-title--indicacao { color: var(--navy); }

.code-item--bonus { border-left: 3px solid var(--italian-red); }
.code-item--indicacao { border-left: 3px solid var(--navy); }

.code-origin-name {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Referral Items ── */
.referral-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--warm-bg);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.referral-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.referral-status.done { background: var(--success); }
.referral-status.pending { background: var(--gold); }

.referral-info { flex: 1; }
.referral-info .name { font-size: 14px; font-weight: 600; color: var(--charcoal); }
.referral-info .phone { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.referral-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.referral-badge.done { background: var(--success-bg); color: var(--success); }
.referral-badge.pending { background: #FFF8EC; color: var(--gold-dark); }

/* ── Stats ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.stat-box {
  text-align: center;
  padding: 14px 8px;
  background: var(--warm-bg);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-sm);
}

.stat-box .number {
  font-size: 22px;
  font-weight: 700;
  color: var(--charcoal);
  font-family: 'DM Serif Display', serif;
}

.stat-box .label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  display: none;
  animation: portalFadeUp 0.3s ease;
}

.alert.show { display: flex; align-items: flex-start; gap: 8px; }
.alert-icon { font-size: 16px; flex-shrink: 0; line-height: 1.3; }
.alert-error { background: var(--error-bg); color: var(--error); border: 1px solid #F0D0D0; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #C8E0CC; }
.alert-info { background: var(--info-bg); color: var(--info); border: 1px solid #D0DCF0; }

/* ── Spinner ── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: portalSpin 0.6s linear infinite;
}

.spinner-dark {
  border-color: rgba(0,0,0,0.1);
  border-top-color: var(--gold);
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
}

.empty-state .icon { font-size: 36px; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { font-size: 13px; line-height: 1.5; }

/* ── Legend ── */
.legend { display: flex; gap: 16px; margin-bottom: 12px; }

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.legend-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Animations ── */
@keyframes portalFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes portalFadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes portalSpin {
  to { transform: rotate(360deg); }
}

/* ── Responsive ── */
@media (max-width: 400px) {
  .portal-container { padding: 16px 12px 40px; }
  .card { padding: 22px 18px; }
  .portal-header h1 { font-size: 24px; }
  .tab-btn { font-size: 11.5px; padding: 9px 6px; }
  .stats-row { gap: 6px; }
}

/* ══ Modal Indicar uma Amiga ══ */
.indicar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.indicar-overlay.open {
  display: flex;
  animation: portalFadeUp 0.22s ease;
}

.indicar-modal {
  background: var(--warm-bg);
  border-radius: 18px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 24px 32px;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: indicarSlideUp 0.28s cubic-bezier(0.34, 1.3, 0.64, 1);
}

@keyframes indicarSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.indicar-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.indicar-modal-header h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  color: var(--charcoal);
  margin: 8px 0 4px;
  line-height: 1.2;
}

.indicar-modal-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.indicar-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
  flex-shrink: 0;
  line-height: 1;
}

.indicar-close-btn:hover {
  background: var(--warm-border);
  color: var(--charcoal);
}

/* Prevent body scroll when modal is open */
body.indicar-modal-open { overflow: hidden; }

/* Scrollbar inside modal */
.indicar-modal::-webkit-scrollbar { width: 4px; }
.indicar-modal::-webkit-scrollbar-track { background: transparent; }
.indicar-modal::-webkit-scrollbar-thumb { background: var(--warm-border); border-radius: 4px; }

@media (max-width: 400px) {
  .indicar-modal { padding: 20px 16px 28px; border-radius: 14px; }
  .indicar-modal-header h2 { font-size: 19px; }
}
