/*
 * VisitCard — version one page statique
 * Charte reprise de backend/tailwind.config.js (drapeau du Bénin).
 */

:root {
    --primary: #0b6736;
    --primary-50: #eefaf2;
    --primary-700: #09522d;
    --gold: #f9c71a;
    --accent: #be0a0b;

    --surface-50: #f8faf9;
    --surface-100: #f1f5f2;
    --surface-200: #e3eae5;
    --surface-400: #9cafa2;
    --surface-500: #6f8577;
    --surface-600: #4e6255;
    --surface-800: #223027;
    --surface-900: #141e18;

    --shadow-card: 0 2px 10px rgba(20, 30, 24, 0.1);
    --shadow-float: 0 12px 40px rgba(11, 103, 54, 0.18);
    --flag: linear-gradient(
        to right,
        var(--primary) 0 33.33%,
        var(--gold) 33.33% 66.66%,
        var(--accent) 66.66% 100%
    );
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--surface-100);
    color: var(--surface-900);
    font-family: Montserrat, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

/* Bandeau tricolore, comme le bas de la carte imprimée */
.flag-bar {
    height: 0.375rem;
    width: 100%;
    background: var(--flag);
}

.flag-bar--fixed {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
}

.flag-underline {
    display: block;
    height: 0.25rem;
    width: 4rem;
    margin: 0.75rem auto;
    border-radius: 999px;
    background: var(--flag);
}

/* ------------------------------------------------------------------ carte */

.page {
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
    padding: 2rem 1rem 1rem;
}

.card {
    overflow: hidden;
    border-radius: 1.75rem;
    background: #fff;
    box-shadow: var(--shadow-card);
}

.cover {
    position: relative;
}

.cover__image,
.cover__fallback {
    height: 11rem;
    width: 100%;
    background: var(--primary);
    object-fit: cover;
}

.cover__logo {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.375rem 0.625rem;
    border-radius: 0.875rem;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 2px rgba(20, 30, 24, 0.12);
}

.cover__logo img {
    height: 2.25rem;
    width: auto;
}

.lang {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 2px rgba(20, 30, 24, 0.12);
    font-size: 0.75rem;
    font-weight: 700;
}

.lang a {
    padding: 0.375rem 0.75rem;
    color: var(--surface-500);
    text-decoration: none;
}

.lang a.is-active {
    background: var(--primary);
    color: #fff;
}

.portrait {
    position: relative;
    z-index: 10;
    margin-top: -4rem;
    display: flex;
    justify-content: center;
}

.portrait img,
.portrait__initials {
    height: 8rem;
    width: 8rem;
    border-radius: 50%;
    border: 4px solid var(--primary);
    object-fit: cover;
    box-shadow: 0 0 0 4px #fff;
}

.portrait__initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-50);
    color: var(--primary);
    font-size: 1.875rem;
    font-weight: 800;
}

.card__body {
    padding: 1rem 1.5rem 2rem;
}

/* ------------------------------------------------------------- identité */

.identity {
    text-align: center;
}

.identity__name {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.identity__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
}

.identity__function {
    margin: 0.125rem 0 0;
    font-style: italic;
    color: var(--surface-600);
}

.identity__org {
    margin: 0.75rem 0 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--surface-500);
}

.identity__org span {
    display: block;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
}

/* --------------------------------------------------------------- actions */

.chips {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.chip {
    display: inline-flex;
    height: 3rem;
    width: 3rem;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary);
    border-radius: 0.875rem;
    color: var(--primary);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.chip:hover,
.chip:focus-visible {
    background: var(--primary);
    color: #fff;
}

.chip svg {
    height: 1.25rem;
    width: 1.25rem;
}

.actions {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 1.25rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn svg {
    height: 1.25rem;
    width: 1.25rem;
}

.btn--primary {
    padding: 1rem 1.5rem;
    border: none;
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-float);
}

.btn--primary:hover {
    background: var(--primary-700);
}

.btn--outline {
    padding: 0.875rem 1.5rem;
    border: 2px solid var(--primary);
    background: #fff;
    color: var(--primary);
}

.btn--outline:hover {
    background: var(--primary-50);
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(11, 103, 54, 0.25);
}

/* ----------------------------------------------------------- coordonnées */

.details {
    margin-top: 1.75rem;
    overflow: hidden;
    border: 1px solid var(--surface-200);
    border-radius: 1.25rem;
}

.details__title {
    margin: 0;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--surface-200);
    background: var(--surface-50);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--surface-500);
}

.details dl {
    margin: 0;
}

.row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--surface-100);
}

.row:first-child {
    border-top: none;
}

.row__icon {
    display: flex;
    height: 2.25rem;
    width: 2.25rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary);
    border-radius: 0.5rem;
    color: var(--primary);
}

.row__icon svg {
    height: 1rem;
    width: 1rem;
}

.row__text {
    min-width: 0;
}

.row dt {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--surface-400);
}

.row dd {
    margin: 0;
    overflow-wrap: break-word;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--surface-800);
}

.row dd a {
    text-decoration: none;
}

.row dd a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ---------------------------------------------------------------- QR code */

.qr {
    margin-top: 1.75rem;
    text-align: center;
}

.qr__title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--surface-800);
}

.qr__frame {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--surface-200);
    border-radius: 1.25rem;
    background: #fff;
    box-shadow: 0 1px 2px rgba(20, 30, 24, 0.08);
}

.qr__frame img {
    height: 12rem;
    width: 12rem;
}

.qr__hint {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    color: var(--surface-500);
}

.qr__download {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.qr__download:hover {
    text-decoration: underline;
}

.qr__download svg {
    height: 1rem;
    width: 1rem;
}

/* --------------------------------------------------------------- pied de carte */

.emblem {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--surface-100);
    text-align: center;
}

.emblem img {
    margin: 0 auto;
    width: 100%;
    max-width: 16rem;
    height: auto;
}

.slogan {
    margin: 1rem 0 0;
    text-align: center;
    font-weight: 600;
    font-style: italic;
    color: var(--accent);
}

.site-footer {
    padding: 1.5rem 1rem 2.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--surface-500);
}

.site-footer strong {
    color: var(--primary);
}

@media print {
    body {
        background: #fff;
    }

    .flag-bar--fixed,
    .lang,
    .actions,
    .qr__download,
    .site-footer {
        display: none;
    }

    .card {
        box-shadow: none;
    }
}
