:root {
  --accent: #8bb9ab;
  --text: #f4f4f4;
  --muted: #c9c9cf;
  --border: rgba(255, 255, 255, 0.14);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    'Montserrat',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    sans-serif;
  background: #0e0e10;
  color: var(--text);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  padding: 16px;
}

.card {
  position: relative;
  margin: auto;
  width: auto;
  height: min(94vh, 780px);
  min-height: 580px;
  aspect-ratio: 9 / 16;
  max-width: calc(100vw - 32px);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Photo en fond plein */
.card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.card-bg.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #2a2a2e, #131315);
}

.card-bg.placeholder span {
  font-size: 80px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 2px;
}

/* Voile sombre en bas pour la lisibilite */
.card-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.45) 52%, rgba(0, 0, 0, 0.82) 100%);
}

/* Contenu superpose, colle en bas (porte par le flex de .card) */
.content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: 0 14px 40px;
  gap: 12px;
}

.identity {
  text-align: center;
  padding: 0 6px;
}

.name {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.title {
  margin-top: 2px;
  font-size: 1rem;
  color: var(--accent);
  font-weight: 600;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

/* Boutons ronds */
.actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.action {
  border-radius: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px 16px;
  background: rgba(36, 54, 64, 0.5);
  backdrop-filter: blur(5.05px);
  -webkit-backdrop-filter: blur(5.05px);
  border: none;
  color: var(--text);
  text-decoration: none;
  transition:
    background 0.2s,
    transform 0.1s;
}

.action:hover {
  background: rgba(36, 54, 64, 0.99);
}

.action:active {
  transform: scale(0.94);
}

.action svg {
  min-width: 25px;
  height: 25px;
}

/* Panneaux verre depoli (la photo derriere est floutee) */
.glass {
  border-radius: 58px;
  background: rgba(36, 54, 64, 0.5);
  backdrop-filter: blur(5.05px);
  -webkit-backdrop-filter: blur(5.05px);
  border: none;
  padding: 15px 16px;
}

.agency {
  display: flex;
  align-items: center;
  gap: 13px;
}

.agency-logo {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: none;
}

.agency-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agency-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.agency-line {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
  display: block;
  text-decoration: none;
}

.agency-phone:hover {
  color: var(--text);
}

/* Footer : verre depoli (via .glass) */
.footer {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-social {
  display: flex;
  gap: 5px;
}

.footer-social a {
  color: var(--text);
  display: flex;
  align-items: center;
}

.website {
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
  word-break: break-all;
}

.website:hover {
  color: var(--text);
}

/* Bouton partager (coin haut droit) */
.share-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(40, 40, 44, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.1s;
}

.share-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.share-btn:active {
  transform: scale(0.94);
}

/* Modale de partage */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 320px;
  background: #1a1a1d;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.modal-qr {
  width: 200px;
  height: 200px;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

.modal-url {
  margin: 14px 0;
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-all;
}

.modal-copy {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--accent);
  color: #0e0e10;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.modal-copy:hover {
  opacity: 0.9;
}

.modal-copy.copied {
  background: #4caf7d;
  color: #fff;
}

/* 404 */
.notfound {
  text-align: center;
}

.notfound h1 {
  font-size: 4rem;
  color: var(--accent);
}

.notfound p {
  margin-top: 8px;
  color: var(--muted);
}

/* Mobile : carte plein ecran, sans marge, scroll si besoin */
@media (max-width: 600px) {
  body {
    display: block;
    padding: 0;
  }

  .card {
    margin: 0;
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    aspect-ratio: auto;
    border-radius: 0;
    box-shadow: none;
  }
}
