/* ========================================
   Mary Kay - Lu Rocha  (v3 - mobile-first, full responsive)
   Rosa claro #fce4ec / Rosa escuro #c2185b / Vinho #880e4f
======================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --pink-light: #fce4ec;
  --pink-mid:   #f48fb1;
  --pink-dark:  #c2185b;
  --pink-deep:  #880e4f;
  --pink-hover: #ad1457;
  --white:      #ffffff;
  --gray:       #f5f5f5;
  --text-dark:  #333;
  --text-mid:   #666;
  --shadow:     0 2px 12px rgba(194,24,91,0.15);
}

html, body {
  font-family: 'Segoe UI', Arial, sans-serif;
  color: var(--text-dark);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

body {
  background: var(--pink-light);
  display: flex;
  flex-direction: column;
  /* Fundo de tela gerenciado via JS (logos.fundoImg) */
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
}

/* ===== HEADER ===== */
#app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--pink-dark);
  padding: 8px 16px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.header-center {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: flex-start;
  min-width: 0;
}

.header-right { flex-shrink: 0; margin-left: 8px; }

.logo-default {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.6);
  color: white;
  font-weight: bold;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

#logo-empresa-img {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.6);
  flex-shrink: 0;
}

.header-title {
  display: flex; flex-direction: column;
  color: white; min-width: 0;
}
.header-title span { font-size: 15px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-title small { font-size: 11px; opacity: 0.85; }

.btn-admin-icon {
  background: rgba(255,255,255,0.2);
  border: 1.5px solid rgba(255,255,255,0.5);
  color: white;
  width: 38px; height: 38px;
  border-radius: 50%;
  font-size: 17px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.btn-admin-icon:hover { background: rgba(255,255,255,0.38); }

/* ===== BANNER ===== */
#banner-section {
  position: relative;
  min-height: 340px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--pink-deep), var(--pink-dark));
  flex-shrink: 0;
}

#banner-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  opacity: 0.82;
  transition: opacity 0.4s;
}

.banner-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 340px;
  padding: 28px 20px 36px;
  text-align: center;
}

.banner-text h1 {
  color: white;
  font-size: 28px;
  font-weight: 800;
  text-shadow: 1px 2px 10px rgba(0,0,0,0.6);
  line-height: 1.3;
}

/* ===== CARDS PRINCIPAIS ===== */
#main-cards {
  padding: 22px 14px 16px;
  flex: 1;
  background: rgba(252,228,236,0.85);
}

.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 520px;
  margin: 0 auto;
}

.card {
  background: rgba(255,255,255,0.96);
  border-radius: 16px;
  padding: 22px 12px 18px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.18s, box-shadow 0.18s;
  border: 1.5px solid #f8bbd0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.card:hover, .card:active {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(194,24,91,0.3);
}

.card-icon { font-size: 38px; margin-bottom: 10px; line-height: 1; }
.card-title { font-size: 13px; font-weight: 700; color: var(--pink-dark); margin-bottom: 4px; }
.card-desc  { font-size: 11px; color: var(--text-mid); line-height: 1.4; }

/* ===== BOTOES REDES SOCIAIS ===== */
.social-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  padding: 14px 14px 6px;
  flex-wrap: wrap;
}

.btn-social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 30px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, opacity 0.2s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  min-width: 140px;
  justify-content: center;
}

.btn-social:hover, .btn-social:active {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.28);
}

.btn-instagram {
  background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: white;
}

.btn-instagram:hover { opacity: 0.92; }

.btn-facebook {
  background: #1877f2;
  color: white;
}

.btn-facebook:hover { background: #0d65d9; }

.btn-social i { font-size: 18px; }

@media (max-width: 600px) {
  .social-buttons { gap: 10px; padding: 12px 10px 4px; }
  .btn-social { padding: 11px 18px; font-size: 14px; min-width: 120px; }
  .btn-social i { font-size: 16px; }
}

/* ===== FOOTER ===== */
#app-footer {
  background: var(--pink-dark);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  min-height: 52px;
  margin-top: auto;
  flex-shrink: 0;
}

.footer-vsual { display: flex; align-items: center; gap: 10px; }
#logo-vsual-img { height: 26px; width: auto; object-fit: contain; }
#footer-vsual-text { display: flex; flex-direction: column; align-items: center; text-align: center; }
.vsual-name { font-size: 12px; font-weight: 600; opacity: 0.96; line-height: 1.2; }
.vsual-tel  { font-size: 11px; opacity: 0.82; line-height: 1.2; }

/* ===== MODAL OVERLAY ===== */
#modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
}

/* ===== MODAIS ===== */
.modal {
  position: fixed; inset: 0;
  z-index: 201;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  pointer-events: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-box {
  background: white;
  border-radius: 18px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  pointer-events: all;
  box-shadow: 0 12px 50px rgba(0,0,0,0.32);
  -webkit-overflow-scrolling: touch;
}

.modal-box-large { max-width: 700px; }

.modal-header {
  background: var(--pink-dark);
  color: white;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 18px 18px 0 0;
  font-weight: 700;
  font-size: 15px;
  position: sticky; top: 0; z-index: 1;
}

.pink-header { background: var(--pink-dark); }

.modal-close {
  background: rgba(255,255,255,0.2);
  border: none; color: white;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; flex-shrink: 0;
}
.modal-close:hover { background: rgba(255,255,255,0.42); }

.modal-body { padding: 16px; }
.modal-intro { color: var(--text-mid); font-size: 14px; margin-bottom: 16px; text-align: center; }

/* ===== ADMIN LOGIN ===== */
.admin-login {
  padding: 24px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.admin-login h3 { text-align: center; color: var(--pink-dark); font-size: 18px; }

.pass-wrap { position: relative; }
.pass-wrap .inp-pink { padding-right: 46px; }
.btn-eye {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer; color: var(--pink-dark);
  font-size: 16px; padding: 4px;
}

/* ===== ADMIN GRID ===== */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px; padding: 16px;
}
.admin-btn {
  background: var(--pink-light);
  border: 1px solid #f8bbd0;
  border-radius: 12px;
  padding: 14px 6px;
  text-align: center; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--pink-dark);
  transition: background 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.admin-btn:hover, .admin-btn:active { background: #f8bbd0; transform: translateY(-1px); }
.admin-btn-icon { font-size: 24px; margin-bottom: 5px; }

/* ===== INPUTS ===== */
.inp-pink {
  width: 100%;
  border: 1.5px solid #f48fb1;
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 16px; /* 16px evita zoom iOS */
  color: var(--text-dark);
  outline: none;
  transition: border 0.2s;
  background: white;
  -webkit-appearance: none;
}
.inp-pink:focus { border-color: var(--pink-dark); box-shadow: 0 0 0 3px rgba(194,24,91,0.12); }
textarea.inp-pink { resize: vertical; min-height: 70px; }

/* ===== BOTÕES ===== */
.btn-pink {
  background: var(--pink-dark);
  color: white; border: none;
  padding: 12px 20px;
  border-radius: 8px; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: background 0.2s;
  display: inline-flex; align-items: center;
  justify-content: center; gap: 6px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn-pink:hover, .btn-pink:active { background: var(--pink-hover); }
.btn-large { padding: 14px 28px; font-size: 16px; }

.btn-outline {
  background: transparent;
  color: var(--pink-dark);
  border: 1.5px solid var(--pink-dark);
  padding: 12px 20px;
  border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
  display: inline-flex; align-items: center;
  justify-content: center; gap: 6px;
}
.btn-outline:hover, .btn-outline:active { background: var(--pink-light); }

.btn-success {
  background: #2e7d32; color: white; border: none;
  padding: 12px 20px; border-radius: 8px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-success:hover { background: #1b5e20; }

.btn-danger {
  background: #e53935; color: white; border: none;
  padding: 8px 14px; border-radius: 6px;
  font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; font-weight: 600;
}
.btn-danger:hover { background: #c62828; }

.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 6px; }

.btn-row {
  display: flex; gap: 10px;
  flex-wrap: wrap; margin-top: 12px;
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--pink-dark); margin-bottom: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ===== TABELA ===== */
.table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #f8bbd0;
  margin-top: 10px;
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; min-width: 360px; }
th { background: var(--pink-dark); color: white; padding: 9px 10px; font-size: 12px; text-align: left; white-space: nowrap; }
td { padding: 8px 10px; font-size: 12px; border-bottom: 1px solid #fce4ec; }
tr:nth-child(even) td { background: #fff9fb; }
tr:hover td { background: var(--pink-light); }

/* ===== CURSOS CARDS ===== */
.curso-card {
  background: white;
  border: 1px solid #f8bbd0;
  border-radius: 14px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.curso-card-foto { width: 100%; max-height: 300px; object-fit: cover; display: block; }
.curso-card-foto-placeholder {
  width: 100%; height: 160px;
  background: linear-gradient(135deg, #fce4ec, #f8bbd0);
  display: flex; align-items: center; justify-content: center;
  font-size: 52px;
}
.curso-card-body { padding: 14px; }
.curso-card-body h4 { color: var(--pink-dark); font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.curso-card-body p { font-size: 13px; color: var(--text-mid); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.curso-card-body .valor { font-weight: 700; color: var(--pink-dark); font-size: 15px; margin-top: 6px; }

/* ===== PIX DISPLAY (Quero Participar) ===== */
.pix-area {
  background: var(--pink-light);
  border: 1.5px solid #f48fb1;
  border-radius: 12px;
  padding: 14px;
  margin-top: 16px;
  text-align: center;
}
.pix-area h4 { color: var(--pink-dark); font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.pix-key {
  background: white;
  border: 1.5px dashed var(--pink-mid);
  border-radius: 8px;
  padding: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--pink-deep);
  word-break: break-all;
  cursor: pointer;
  margin-bottom: 8px;
}
.pix-key:hover { background: #fff0f5; }
.pix-qr img { max-width: 180px; width: 100%; border-radius: 8px; border: 2px solid #f48fb1; }

/* ===== KIT MÍDIA ===== */
.kitmedia-imgs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 16px;
}
.kitmedia-imgs img {
  width: 100%; aspect-ratio: 1;
  object-fit: cover; border-radius: 10px;
  border: 1px solid #f8bbd0;
  cursor: zoom-in; transition: transform 0.2s;
}
.kitmedia-imgs img:hover { transform: scale(1.05); }

/* ===== UPLOAD PREVIEW ===== */
.img-preview-wrap { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.img-preview { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1.5px solid #f8bbd0; }

.upload-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--pink-light); color: var(--pink-dark);
  border: 1.5px dashed var(--pink-dark);
  padding: 8px 14px; border-radius: 8px;
  cursor: pointer; font-size: 13px; font-weight: 600;
  transition: background 0.2s;
}
.upload-btn:hover { background: #f8bbd0; }

/* ===== KIT ADMIN GRID ===== */
.kit-imgs-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px; margin-bottom: 16px;
}
.kit-img-slot { position: relative; aspect-ratio: 1; }
.kit-img-slot img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; border: 1.5px solid #f8bbd0; display: block; }
.kit-img-empty {
  width: 100%; height: 100%;
  background: #fce4ec; border-radius: 8px;
  border: 2px dashed #f48fb1;
  display: flex; align-items: center; justify-content: center;
  color: var(--pink-dark); font-size: 20px; font-weight: 700;
}
.kit-img-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(194,24,91,0.85); color: white;
  text-align: center; font-size: 10px; padding: 3px;
  border-radius: 0 0 8px 8px; cursor: pointer;
}
.kit-img-remove {
  position: absolute; top: 3px; right: 3px;
  background: #c62828; color: white; border: none;
  border-radius: 50%; width: 20px; height: 20px;
  cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; line-height: 1;
}

/* Input file hidden */
input[type="file"] { display: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--pink-light); }
::-webkit-scrollbar-thumb { background: var(--pink-mid); border-radius: 3px; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 80px; left: 50%;
  transform: translateX(-50%);
  background: var(--pink-deep); color: white;
  padding: 12px 28px; border-radius: 26px;
  font-size: 14px; font-weight: 600;
  z-index: 999; box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  max-width: 92vw; text-align: center;
  animation: fadeInUp 0.3s;
  white-space: nowrap;
}
.toast.success { background: #2e7d32; }
.toast.error   { background: #c62828; }
.toast.info    { background: var(--pink-dark); }

/* ===== FLOATING SAVE ===== */
.floating-saved {
  position: fixed; top: 70px; right: 16px;
  background: #2e7d32; color: white;
  padding: 10px 18px; border-radius: 20px;
  font-size: 14px; font-weight: 600;
  z-index: 998; box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  display: flex; align-items: center; gap: 6px;
  animation: slideInRight 0.35s;
}

@keyframes fadeInUp {
  from { opacity:0; transform: translateX(-50%) translateY(12px); }
  to   { opacity:1; transform: translateX(-50%) translateY(0); }
}
@keyframes slideInRight {
  from { opacity:0; transform: translateX(60px); }
  to   { opacity:1; transform: translateX(0); }
}

/* ===== MISC ===== */
.loading { text-align: center; padding: 36px; color: var(--pink-dark); font-size: 15px; }
.text-center { text-align: center; }
.empty-state { text-align: center; padding: 36px 20px; color: var(--text-mid); font-size: 14px; }
.empty-state .empty-icon { font-size: 44px; margin-bottom: 12px; }

.section-title {
  font-size: 15px; font-weight: 700; color: var(--pink-dark);
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 2px solid var(--pink-mid);
}

.tag-tipo {
  display: inline-block;
  background: var(--pink-light); color: var(--pink-dark);
  padding: 3px 9px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
}

/* ===== PRODUTOS GRID ===== */
.produtos-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.produto-card { background: white; border: 1px solid #f8bbd0; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.produto-card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.produto-card-foto-placeholder { width: 100%; aspect-ratio: 1; background: linear-gradient(135deg,#fce4ec,#f8bbd0); display: flex; align-items: center; justify-content: center; font-size: 48px; }
.produto-card-info { padding: 10px; text-align: center; }
.produto-card-info h4 { font-size: 13px; color: var(--pink-dark); margin-bottom: 4px; font-weight: 700; }
.produto-card-info .valor { font-size: 14px; font-weight: 700; color: var(--pink-deep); }

/* ===== RESPONSIVO MOBILE ===== */
@media (max-width: 600px) {
  /* Banner maior no mobile */
  #banner-section { min-height: 300px; }
  .banner-content  { min-height: 300px; padding: 24px 16px 32px; align-items: flex-end; }
  .banner-text h1  { font-size: 22px; }

  /* Cards */
  .cards-grid { gap: 10px; }
  .card { padding: 18px 10px 14px; }
  .card-icon  { font-size: 32px; }
  .card-title { font-size: 12px; }
  .card-desc  { font-size: 10px; }

  /* Admin grid */
  .admin-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .admin-btn  { padding: 10px 4px; font-size: 10px; }
  .admin-btn-icon { font-size: 20px; }

  .modal-box-large { max-width: 100%; border-radius: 14px; }
  .form-row        { grid-template-columns: 1fr; }

  .kitmedia-imgs { grid-template-columns: repeat(2, 1fr); }
  .kit-imgs-grid { grid-template-columns: repeat(4, 1fr); }

  .header-title span { font-size: 14px; }
  .header-title small { font-size: 10px; }

  .table-wrap { font-size: 11px; }
  .produto-card-info h4 { font-size: 12px; }

  /* Footer maior */
  #app-footer { min-height: 58px; }

  /* Botões maiores no mobile */
  .btn-pink, .btn-outline, .btn-success { padding: 13px 16px; }

  /* PIX QR */
  .pix-qr img { max-width: 150px; }
}

@media (max-width: 380px) {
  .admin-grid  { grid-template-columns: repeat(3, 1fr); }
  .kit-imgs-grid { grid-template-columns: repeat(3, 1fr); }
  .kitmedia-imgs { grid-template-columns: repeat(2, 1fr); }
  .banner-text h1 { font-size: 19px; }
}

@media (min-width: 700px) {
  #banner-section { min-height: 420px; }
  .banner-content  { min-height: 420px; padding: 40px 32px 52px; }
  .banner-text h1  { font-size: 34px; }
  #main-cards { padding: 28px 24px 20px; }
  .cards-grid { gap: 18px; max-width: 560px; }
  .card { padding: 28px 18px 22px; }
  .card-icon { font-size: 44px; }
  .card-title { font-size: 15px; }
  .card-desc  { font-size: 12px; }
}

/* ===== PRINT ===== */
@media print {
  #app-header, #app-footer, .btn-row, .btn-pink, .btn-outline, .btn-danger,
  #modal-overlay { display: none !important; }
}
