/**
 * AAC — Carteira Digital Oficial do Associado v9
 * Cartão ID-1 (85.6 / 54 ≈ 1.585:1) desenhado integralmente em HTML/CSS/SVG
 */

.aac-wallet {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  aspect-ratio: 85.6 / 54;
  perspective: 1400px;
  container-type: inline-size;
  font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.aac-card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.68s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}

.aac-card.is-flipped {
  transform: rotateY(180deg);
}

.aac-face {
  position: absolute;
  inset: 0;
  border-radius: 3.6cqw;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow:
    0 18px 40px rgba(2, 18, 44, 0.36),
    0 0 0 1px rgba(255, 255, 255, 0.16);
}

.aac-card.is-flipped .aac-front {
  pointer-events: none;
}

.aac-card:not(.is-flipped) .aac-back {
  pointer-events: none;
}

/* ==================== FRENTE ==================== */

.aac-front {
  transform: rotateY(0deg);
  background: linear-gradient(135deg, #F0F9FF 0%, #DEF2FD 55%, #CAEAF9 100%);
  color: #052D62;
}

/* Ilustração costeira direita limpa recortada em diagonal */
.aac-front-art {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 44cqw;
  clip-path: polygon(22.9% 0%, 100% 0%, 100% 100%, 3.2% 100%);
  -webkit-clip-path: polygon(22.9% 0%, 100% 0%, 100% 100%, 3.2% 100%);
  background: #064C9E;
  z-index: 1;
}

.aac-front-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 92% center;
  display: block;
}

/* Filete diagonal amarelo vetorial */
.aac-front-divider {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

/* Selo geográfico inferior direito */
.aac-front-loc {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 4;
  background: linear-gradient(90deg, #04326D 0%, #053E87 100%);
  color: #FFFFFF;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 2.05cqw;
  font-weight: 700;
  letter-spacing: 0.015em;
  line-height: 1;
  padding: 1.15cqw 3.0cqw 1.25cqw 4.4cqw;
  clip-path: polygon(11% 0%, 100% 0%, 100% 100%, 0% 100%);
  -webkit-clip-path: polygon(11% 0%, 100% 0%, 100% 100%, 0% 100%);
  box-shadow: 0 -2px 10px rgba(2, 18, 44, 0.24);
  white-space: nowrap;
}

/* Coluna esquerda da Frente */
.aac-front-body {
  position: relative;
  z-index: 4;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3.3cqw 0 3.4cqw 3.4cqw;
  box-sizing: border-box;
}

/* Cabeçalho: Brasão AAC + Título Institucional */
.aac-front-head {
  display: flex;
  align-items: center;
  gap: 1.8cqw;
}

.aac-logo {
  height: 17.6cqw;
  width: auto;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(5, 45, 98, 0.12));
}

.aac-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 0.3cqw;
}

.aac-brand-title {
  font-family: 'Barlow Condensed', 'DM Sans', sans-serif;
  font-weight: 800;
  font-size: 4.15cqw;
  line-height: 0.94;
  color: #042E68;
  letter-spacing: 0.012em;
  text-transform: uppercase;
}

.aac-brand-rule {
  width: 11cqw;
  height: 0.68cqw;
  background: #F5B400;
  border-radius: 1cqw;
  margin-top: 0.9cqw;
}

/* Faixa azul-marinho "CARTEIRINHA DO ASSOCIADO" + chanfro paralelo */
.aac-ribbon-row {
  display: flex;
  align-items: center;
  gap: 0.8cqw;
  width: 45.4cqw;
  margin: 0.2cqw 0;
}

.aac-ribbon {
  flex: 1 1 auto;
  height: 4.9cqw;
  padding: 0 2.6cqw 0 1.8cqw;
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, #04326D 0%, #074593 100%);
  color: #FFFFFF;
  font-family: 'Barlow Condensed', 'DM Sans', sans-serif;
  font-weight: 800;
  font-size: 3.15cqw;
  letter-spacing: 0.045em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  border-radius: 0.5cqw 0 0 0.5cqw;
  clip-path: polygon(0% 0%, 100% 0%, calc(100% - 0.86cqw) 100%, 0% 100%);
  -webkit-clip-path: polygon(0% 0%, 100% 0%, calc(100% - 0.86cqw) 100%, 0% 100%);
  box-shadow: 0 2px 6px rgba(4, 50, 109, 0.2);
}

.aac-ribbon-slash {
  width: 2.3cqw;
  height: 4.9cqw;
  flex-shrink: 0;
  background: #F5B400;
  clip-path: polygon(0.86cqw 0%, 100% 0%, calc(100% - 0.86cqw) 100%, 0% 100%);
  -webkit-clip-path: polygon(0.86cqw 0%, 100% 0%, calc(100% - 0.86cqw) 100%, 0% 100%);
}

/* Área inferior da Frente: Foto 3x4 + Dados do Titular */
.aac-member-row {
  display: flex;
  align-items: stretch;
  gap: 2.2cqw;
}

.aac-photo {
  width: 15.8cqw;
  height: 21.6cqw;
  flex-shrink: 0;
  border-radius: 1.5cqw;
  background: #E2E8F0;
  border: 0.24cqw solid #A5B8CE;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(4, 50, 109, 0.14);
}

.aac-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}

.aac-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8cqw;
  color: #8496AB;
  background: linear-gradient(180deg, #E5ECF3 0%, #D9E2EC 100%);
}

.aac-photo-placeholder svg {
  width: 8.6cqw;
  height: 8.6cqw;
  fill: #94A3B8;
}

.aac-photo-placeholder span {
  font-size: 1.75cqw;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #64748B;
}

/* Bloco de texto do Titular */
.aac-info {
  width: 24.4cqw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.aac-role-lbl {
  font-size: 1.55cqw;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #47688F;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 0.55cqw;
}

.aac-name {
  font-family: 'Barlow Condensed', 'DM Sans', sans-serif;
  font-weight: 800;
  font-size: 3.65cqw;
  line-height: 1.02;
  color: #042E68;
  text-transform: uppercase;
  letter-spacing: 0.015em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.aac-name.is-long {
  font-size: 2.95cqw;
}

.aac-name.is-xlong {
  font-size: 2.45cqw;
}

.aac-name-rule {
  width: 22.8cqw;
  height: 0.52cqw;
  background: #F5B400;
  border-radius: 1cqw;
  margin: 1.0cqw 0 1.25cqw;
}

.aac-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5cqw;
}

.aac-meta-line {
  font-size: 1.95cqw;
  line-height: 1.24;
  color: #153862;
  white-space: nowrap;
}

.aac-meta-lbl {
  font-weight: 500;
  color: #264A75;
}

.aac-meta-val {
  font-weight: 800;
  color: #042E68;
}

.aac-rh-row {
  margin-top: 1.05cqw;
}

.aac-rh-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.65cqw;
  padding: 0.45cqw 1.25cqw 0.48cqw 1.0cqw;
  background: rgba(254, 226, 226, 0.92);
  border: 0.18cqw solid rgba(220, 38, 38, 0.28);
  border-radius: 99px;
  font-size: 1.72cqw;
  font-weight: 600;
  color: #991B1B;
  line-height: 1;
}

.aac-rh-badge b {
  font-weight: 800;
  color: #7F1D1D;
}

.aac-rh-drop {
  font-size: 1.65cqw;
  line-height: 1;
}

/* ==================== VERSO ==================== */

.aac-back {
  transform: rotateY(180deg);
  background: #03224E;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.aac-back-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.aac-back-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% center;
  display: block;
}

.aac-back-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(96deg, rgba(2, 22, 58, 0.74) 0%, rgba(2, 26, 68, 0.44) 48%, rgba(2, 28, 72, 0.04) 74%),
    linear-gradient(180deg, rgba(2, 24, 62, 0.28) 0%, rgba(2, 24, 62, 0) 40%, rgba(2, 20, 50, 0.14) 100%);
}

.aac-back-main {
  position: relative;
  z-index: 3;
  flex: 1 1 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3cqw;
  padding: 5.0cqw 4.4cqw 0 4.6cqw;
}

.aac-back-copy {
  max-width: 56cqw;
}

.aac-back-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.9cqw;
  font-size: 1.65cqw;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #BAE6FD;
  text-transform: uppercase;
  margin-bottom: 1.5cqw;
}

.aac-kicker-dot {
  width: 1.1cqw;
  height: 1.1cqw;
  border-radius: 50%;
  background: #A3E635;
  box-shadow: 0 0 8px rgba(163, 230, 53, 0.8);
}

.aac-back-slogan {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 800;
  font-size: 3.95cqw;
  line-height: 1.12;
  color: #FFFFFF;
  text-shadow: 0 0.25cqw 0.9cqw rgba(1, 14, 38, 0.55);
}

.aac-back-rule {
  width: 10.5cqw;
  height: 0.62cqw;
  background: #F5B400;
  border-radius: 1cqw;
  margin: 1.8cqw 0 1.8cqw;
}

.aac-ods-list {
  display: flex;
  flex-direction: column;
  gap: 0.7cqw;
}

.aac-ods-item {
  font-size: 2.05cqw;
  font-weight: 500;
  line-height: 1.25;
  color: #F1F5F9;
  text-shadow: 0 0.15cqw 0.5cqw rgba(1, 14, 38, 0.75);
}

.aac-ods-tag {
  font-weight: 800;
  color: #FDE047;
}

.aac-ods-sep {
  opacity: 0.75;
  margin: 0 0.2cqw;
}

/* Box Branco do QR Code */
.aac-qr-wrap {
  flex-shrink: 0;
  margin-top: 0.2cqw;
}

.aac-qr-box {
  width: 24.4cqw;
  background: #FFFFFF;
  border-radius: 2.1cqw;
  padding: 1.85cqw 1.85cqw 1.45cqw;
  box-sizing: border-box;
  box-shadow:
    0 1.1cqw 2.8cqw rgba(1, 16, 42, 0.42),
    0 0 0 0.2cqw rgba(255, 255, 255, 0.85);
}

.aac-qr-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 1.55cqw;
  box-sizing: border-box;
}

/* 4 Cantoneiras de mira do QR Code */
.aac-c {
  position: absolute;
  width: 2.7cqw;
  height: 2.7cqw;
  border-color: #04326D;
  border-style: solid;
  pointer-events: none;
}

.aac-c.tl { top: 0; left: 0; border-width: 0.52cqw 0 0 0.52cqw; border-top-left-radius: 0.5cqw; }
.aac-c.tr { top: 0; right: 0; border-width: 0.52cqw 0.52cqw 0 0; border-top-right-radius: 0.5cqw; }
.aac-c.bl { bottom: 0; left: 0; border-width: 0 0 0.52cqw 0.52cqw; border-bottom-left-radius: 0.5cqw; }
.aac-c.br { bottom: 0; right: 0; border-width: 0 0.52cqw 0.52cqw 0; border-bottom-right-radius: 0.5cqw; }

.aac-qr {
  width: 100%;
  height: 100%;
}

.aac-qr canvas,
.aac-qr img {
  width: 100% !important;
  height: 100% !important;
  image-rendering: pixelated;
}

.aac-qr-cap {
  margin-top: 0.95cqw;
  text-align: center;
  font-size: 1.55cqw;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #042E68;
  text-transform: uppercase;
  line-height: 1;
}

/* Rodapé Oficial Escuro do Verso */
.aac-back-footer {
  position: relative;
  z-index: 4;
  height: 7.4cqw;
  padding: 0 4.6cqw;
  background: linear-gradient(90deg, rgba(4, 23, 52, 0.96) 0%, rgba(7, 34, 74, 0.96) 100%);
  border-top: 0.35cqw solid #F5B400;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2cqw;
}

.aac-back-note {
  font-size: 1.78cqw;
  font-weight: 600;
  letter-spacing: 0.085em;
  color: #CBD5E1;
  text-transform: uppercase;
  white-space: nowrap;
}

.aac-back-mat {
  font-size: 1.95cqw;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #94A3B8;
  white-space: nowrap;
}

.aac-back-mat b {
  color: #F5B400;
  font-weight: 800;
  font-size: 2.15cqw;
}
