/* ============================================================
   MARAVILHA DIGITAL — Área do Associado
   Layout de portal: header + abas, sem sidebar
   ============================================================ */

:root {
  --assoc-header-h: 60px;
  --assoc-nav-h: 52px;
  --accent:       #d4af6e;
  --accent-dark:  #b8963a;
  --dark:         #1a2332;
  --dark2:        #243046;
  --text:         #1a2332;
  --text-muted:   #6b7a99;
  --border:       #e0e5ef;
  --bg:           #f0f2f8;
  --white:        #fff;
  --danger:       #e74c3c;
  --success:      #27ae60;
  --warning:      #f0932b;
  --info:         #2980b9;
  --radius:       10px;
  --shadow:       0 2px 12px rgba(0,0,0,.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body.assoc-body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 70px; /* espaço para nav mobile */
}

/* ── Header ──────────────────────────────────────────────────── */
.assoc-header {
  background: var(--dark);
  height: var(--assoc-header-h);
  display: flex; align-items: center;
  padding: 0 20px;
  gap: 12px;
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
}

.assoc-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}

.assoc-logo img { width: 30px; height: 30px; object-fit: contain; }
.assoc-logo .logo-name { color: #fff; font-size: 15px; font-weight: 700; }
.assoc-logo .logo-sub  { color: var(--accent); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }

.assoc-header-center { flex: 1; }

.assoc-user-chip {
  display: flex; align-items: center; gap: 8px;
}

.assoc-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff;
  flex-shrink: 0;
}

.assoc-user-info { line-height: 1.3; }
.assoc-user-name  { color: #fff; font-size: 13px; font-weight: 600; }
.assoc-user-num   { color: rgba(255,255,255,.55); font-size: 11px; }

.assoc-logout {
  background: rgba(255,255,255,.1);
  border: none; border-radius: 8px;
  color: rgba(255,255,255,.7);
  padding: 6px 10px; cursor: pointer;
  font-size: 12px; font-weight: 600;
  transition: background .15s, color .15s;
  text-decoration: none; display: flex; align-items: center; gap: 4px;
}
.assoc-logout:hover { background: rgba(231,76,60,.25); color: #e74c3c; }

/* ── Notificações (sino) ─────────────────────────────────────── */
.assoc-notif-wrap { position: relative; }
.assoc-notif-bell {
  background: rgba(255,255,255,.1);
  border: none; border-radius: 50%;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer; position: relative;
  color: #fff;
}
.assoc-notif-bell:hover { background: rgba(255,255,255,.2); }
.assoc-notif-badge {
  position: absolute; top: -2px; right: -2px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; line-height: 1;
}
.assoc-notif-painel {
  display: none;
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 300px; max-height: 360px; overflow-y: auto;
  background: var(--white); color: var(--text);
  border-radius: var(--radius); box-shadow: 0 8px 28px rgba(0,0,0,.25);
  z-index: 300;
}
.assoc-notif-painel.active { display: block; }
.assoc-notif-header {
  padding: 12px 14px; font-weight: 700; font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.assoc-notif-list { padding: 6px; }
.assoc-notif-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 12.5px; }
.assoc-notif-item {
  padding: 10px; border-radius: 8px; cursor: pointer;
  transition: background .15s;
}
.assoc-notif-item:hover { background: var(--bg); }
.assoc-notif-item.unread { background: rgba(212,175,110,.12); }
.assoc-notif-msg { font-size: 12.5px; line-height: 1.4; color: var(--text); }
.assoc-notif-time { font-size: 10.5px; color: var(--text-muted); margin-top: 4px; }

/* ── Tabs (desktop) ──────────────────────────────────────────── */
.assoc-tabs {
  background: var(--white);
  border-bottom: 2px solid var(--border);
  display: flex;
  padding: 0 16px;
  position: sticky; top: var(--assoc-header-h); z-index: 190;
  overflow-x: auto;
  scrollbar-width: none;
}
.assoc-tabs::-webkit-scrollbar { display: none; }

.tab-item {
  display: flex; align-items: center; gap: 6px;
  padding: 14px 18px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px; font-weight: 600;
  border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}

.tab-item:hover { color: var(--text); }
.tab-item.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-icon { font-size: 16px; }

/* Badge na aba */
.tab-badge {
  background: var(--danger);
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 5px; border-radius: 10px;
  min-width: 18px; text-align: center;
}

/* ── Content ────────────────────────────────────────────────── */
.assoc-content {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 24px;
}

/* ── Cards ───────────────────────────────────────────────────── */
.assoc-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}

.assoc-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.assoc-card-title {
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}

.assoc-card-body { padding: 16px 18px; }

/* Stats do dashboard */
.assoc-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

/* Quando houver 4 stat cards */
.assoc-stats.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.assoc-stat {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 14px;
  text-align: center;
  border-top: 3px solid var(--accent);
  min-width: 0;
}

.assoc-stat-value {
  font-size: 24px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.assoc-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }

/* ── Formulários ────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }

.form-label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 5px;
}

.form-control, .form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px; color: var(--text);
  background: var(--white);
  outline: none; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  appearance: none; -webkit-appearance: none;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7a99' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212,175,110,.15);
}

textarea.form-control { resize: vertical; min-height: 100px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Botões ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 600;
  cursor: pointer; border: none;
  transition: background .15s, box-shadow .15s, transform .1s;
  text-decoration: none; white-space: nowrap;
  font-family: inherit;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover  { background: var(--accent-dark); box-shadow: 0 4px 12px rgba(212,175,110,.35); }

.btn-secondary { background: #eaecf3; color: var(--text); }
.btn-secondary:hover { background: #d8dce9; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0392b; }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: #eaecf3; color: var(--text); }

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

/* Botões de filtro (abas de status) — estado ativo */
.filtro-status, .filtro-aba { background: #eaecf3; color: var(--text); }
.filtro-status.active, .filtro-aba.active { background: var(--accent); color: #fff; }
.btn-w100 { width: 100%; justify-content: center; }

/* ── Listas de itens (reservas, manifestações) ─────────────── */
.item-list { display: flex; flex-direction: column; gap: 10px; }

.item-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
}

.item-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
  background: rgba(212,175,110,.12);
}

.item-info { flex: 1; min-width: 0; }
.item-title { font-size: 14px; font-weight: 600; }
.item-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.item-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.item-badge { flex-shrink: 0; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  white-space: nowrap;
}
.badge-success   { background: rgba(39,174,96,.12);  color: #229954; }
.badge-danger    { background: rgba(231,76,60,.12);  color: #c0392b; }
.badge-warning   { background: rgba(240,147,43,.12); color: #d68910; }
.badge-info      { background: rgba(41,128,185,.12); color: #2471a3; }
.badge-secondary { background: rgba(107,122,153,.1); color: #6b7a99; }
.badge-primary   { background: rgba(212,175,110,.14); color: #a0762d; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,15,30,.55);
  z-index: 1000;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--white);
  border-radius: 14px;
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: modalIn .2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-16px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none; border: none; font-size: 22px;
  cursor: pointer; color: var(--text-muted);
  padding: 4px; border-radius: 6px; line-height: 1;
}
.modal-close:hover { background: var(--border); }
.modal-body   { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }

/* ── Toast ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 80px; right: 16px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  font-size: 13.5px; color: #fff;
  animation: toastIn .25s ease; max-width: 320px;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger);  }
.toast.warning { background: var(--warning); }
.toast.info    { background: var(--info);    }
@keyframes toastIn { from { opacity:0; transform:translateX(16px); } to { opacity:1; transform:none; } }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 42px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; margin-bottom: 16px; }

/* ── Alert ───────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 13.5px; margin-bottom: 14px;
  border-left: 4px solid transparent;
}
.alert-warning { background: rgba(240,147,43,.1); border-color: var(--warning); color: #7d4f00; }
.alert-info    { background: rgba(41,128,185,.1); border-color: var(--info);    color: #0a3d62; }
.alert-success { background: rgba(39,174,96,.1);  border-color: var(--success); color: #0e5c30; }

/* ── Utilities ───────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-12  { font-size: 12px; }
.fs-13  { font-size: 13px; }
.mb-12  { margin-bottom: 12px; }
.mb-16  { margin-bottom: 16px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* ── Spinner ─────────────────────────────────────────────────── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

/* ── Login page ──────────────────────────────────────────────── */
.login-wrapper {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 15% 20%, rgba(212,175,110,.16), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(212,175,110,.10), transparent 45%),
    linear-gradient(135deg, var(--dark) 0%, #24314a 55%, #2d3f58 100%);
  padding: 20px;
  overflow: hidden;
}

.login-wrapper::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 70%);
  pointer-events: none;
}

.login-box {
  position: relative;
  background: var(--white);
  border-radius: 20px;
  width: 100%; max-width: 400px;
  box-shadow: 0 24px 70px rgba(0,0,0,.38), 0 0 0 1px rgba(255,255,255,.04);
  overflow: hidden;
  animation: loginBoxIn .5s cubic-bezier(.2,.8,.2,1);
}

@keyframes loginBoxIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.login-header {
  position: relative;
  background: linear-gradient(160deg, var(--dark) 0%, var(--dark2) 100%);
  padding: 36px 28px 26px;
  text-align: center;
  overflow: hidden;
}

.login-header::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark), var(--accent));
}

.login-logo {
  margin: 0 auto 12px;
  width: 100%; max-width: 260px; height: auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
}
.login-logo img { width: 100%; height: auto; object-fit: contain; }

.login-title { color: #fff; font-size: 21px; font-weight: 700; letter-spacing: .2px; }
.login-sub   { color: var(--accent); font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.5px; margin-top: 4px; }

.login-body { padding: 30px 28px 28px; }

.login-box .form-group { margin-bottom: 18px; }
.login-box .form-label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--text-muted); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .4px;
}

.login-box .input-wrap { position: relative; }
.login-box .input-wrap .input-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  font-size: 15px; opacity: .55; pointer-events: none;
}
.login-box .form-control {
  width: 100%;
  padding: 11px 14px 11px 38px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: #fafbfd;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.login-box .form-control:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(212,175,110,.18);
}

.login-box .btn-w100 {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: .2px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  cursor: pointer;
  transition: filter .18s ease, transform .12s ease, box-shadow .18s ease;
  box-shadow: 0 6px 18px rgba(184,150,58,.35);
}
.login-box .btn-w100:hover   { filter: brightness(1.06); box-shadow: 0 8px 22px rgba(184,150,58,.45); }
.login-box .btn-w100:active  { transform: translateY(1px); }
.login-box .btn-w100:disabled{ opacity: .7; cursor: default; transform: none; }

.login-box .alert { animation: loginAlertIn .25s ease; }
@keyframes loginAlertIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.login-footnote {
  margin-top: 18px; text-align: center;
}
.login-footnote a {
  font-size: 12px; color: var(--text-muted); text-decoration: none;
  transition: color .15s ease;
}
.login-footnote a:hover { color: var(--accent-dark); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .assoc-stats.cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .assoc-content { padding: 14px 16px; }
  .assoc-stats   { grid-template-columns: 1fr 1fr; }
  .assoc-stats.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .form-row      { grid-template-columns: 1fr; }
  .tab-item      { padding: 12px 10px; font-size: 12px; }
  body.assoc-body { padding-bottom: 72px; }
  .item-card     { flex-wrap: wrap; }

  /* Header minimalista: nome/perfil já ficam na barra inferior */
  .assoc-logo .logo-name,
  .assoc-logo .logo-sub,
  .assoc-user-info,
  .assoc-avatar { display: none; }
  .assoc-header    { padding: 0 14px; gap: 8px; }
  .assoc-user-chip { gap: 6px; }
  .assoc-logo img  { width: 42px; height: 42px; }
}

@media (max-width: 480px) {
  .assoc-content { padding: 12px; }
  .assoc-stats   { grid-template-columns: 1fr 1fr; gap: 10px; }
  .assoc-stat-value { font-size: 20px; }
}

@media (max-width: 360px) {
  .assoc-stats   { grid-template-columns: 1fr; }
  .assoc-stats.cols-4 { grid-template-columns: 1fr; }
}

/* ── Nav mobile (bottom tabs) ────────────────────────────────── */
.mobile-bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 64px;
  background: var(--white);
  border-top: 1px solid var(--border);
  z-index: 300;
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
}

.mobile-bottom-nav .nav-items {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 100%;
}

.mobile-nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; text-decoration: none;
  color: var(--text-muted);
  font-size: 10px; font-weight: 600;
  transition: color .15s;
  position: relative;
}

.mobile-nav-item .nav-icon { font-size: 20px; }
.mobile-nav-item.active { color: var(--accent); }
.mobile-nav-item .mnav-badge {
  position: absolute; top: 8px; right: calc(50% - 14px);
  background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

@media (max-width: 640px) {
  .assoc-tabs        { display: none; }
  .mobile-bottom-nav { display: block; }
}
