html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

#app {
    min-height: 100%;
}

:root {
    /* Card surface */
    --card-radius: 20px;
    --card-text: #F7F3E8;
    --card-shadow: 0 20px 45px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06);
    --card-bg: radial-gradient(circle at top left, #17726f 0%, #0a4743 45%, #041f21 100%);
    /* Text readability */
    --slot-text: #FDF9ED;
    --slot-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
    --slot-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    /* Flip button */
    --flip-bg: linear-gradient(135deg, rgba(10, 71, 67, 0.90), rgba(17, 88, 87, 0.90));
    --flip-shadow: 0 4px 14px rgba(0, 0, 0, 0.40);
    /* Tier chip */
    --tier-bg: radial-gradient(circle at 20% 0%, #fceab6 0%, #f2d27a 45%, #c89b3c 100%);
    --tier-text: #2a210c;
    --tier-shadow: 0 4px 10px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.10);
    /* Premium number font */
    --premium-font: "Roboto Mono", monospace;
    /* QR */
    --qr-size: 118px;
    --qr-radius: 12px;
    --qr-logo-bg: #ffffff;
    --qr-logo-shadow: 0 2px 6px rgba(0,0,0,.40), 0 0 0 1px rgba(255,255,255,.50);
    /* Photo */
    --photo-radius: 16px;
    --photo-border: 1px solid rgba(241, 210, 121, 0.85);
    --photo-shadow: 0 18px 42px rgba(0,0,0,.55);
    /* Luxe accents (Back side) */
    --gold-1: #F9D976;
    --gold-2: #D4A84A;
    --ink: rgba(6, 18, 20, 0.72);
    /* Back typography */
    --back-name-size: 1.22rem;
    --back-meta-size: 0.82rem;
    --back-contact-size: 0.92rem;
}

.card-shell {
    position: relative;
    width: 540px; /* preview size */
    aspect-ratio: 1000 / 630;
    border-radius: var(--card-radius);
    overflow: hidden;
    padding: 0 !important;
    color: var(--card-text);
    box-shadow: var(--card-shadow);
    background: var(--card-bg);
}

/* Large card (dialog) */
.card-shell--lg {
    width: 820px;
    max-width: 94vw;
}

/* Optional: center card in your preview container */
.member-cardPreview {
    display: flex;
    justify-content: center;
    padding-top: 6px;
}

.card-side {
    position: absolute;
    inset: 0;
}

.card-bg {
    z-index: 0;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: drop-shadow(0 0 0 transparent);
}

.card-flipBtnWrap {
    position: absolute;
    right: 14px;
    top: 14px;
    z-index: 6;
}

.card-flipBtn {
    background: var(--flip-bg);
    border-radius: 999px;
    box-shadow: var(--flip-shadow);
}

.slot {
    position: absolute;
    z-index: 2;
    color: var(--slot-text);
    text-shadow: var(--slot-shadow);
    font-family: var(--slot-font);
}

.card-front .company {
    left: 6%;
    top: 7%;
    width: 62%;
    font-size: 1.18rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0.02em;
}

.company-tier {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.company-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.tier-chip {
    font-size: 0.70rem !important;
    padding: 2px 10px !important;
    border-radius: 999px;
    line-height: 1.1;
    background: var(--tier-bg);
    color: var(--tier-text) !important;
    border: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: var(--tier-shadow);
}

.card-front .memberno-premium {
    left: 50%;
    top: 46%;
    transform: translateX(-50%);
    width: 100%;
    text-align: center;
    font-size: 2.6rem;
    font-weight: 900;
    letter-spacing: 0.48em;
    padding-left: 0.48em;
    line-height: 1;
    opacity: 0.98;
    font-family: var(--premium-font);
    background-image: linear-gradient(90deg, rgba(255,255,255,0.15), rgba(0,0,0,0.35)), linear-gradient(90deg, var(--gold-1), #E8A200);
    background-blend-mode: overlay;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 1px 0 rgba(255,255,255,0.15), 0 4px 8px rgba(0,0,0,0.45), 0 0 14px rgba(255,215,0,0.30);
}

.card-front .license {
    left: 6%;
    bottom: 19%;
    width: 62%;
    font-size: 0.86rem;
    opacity: 0.95;
}

.card-front .province {
    left: 6%;
    bottom: 12%;
    width: 62%;
    font-size: 0.86rem;
    opacity: 0.90;
}

.card-front .status {
    right: 6%;
    top: 6%;
}

.card-front .expiry {
    right: 6%;
    top: 16%;
    max-width: 30%;
    font-size: 0.78rem;
    opacity: 0.93;
    text-align: right;
}

/* FRONT watermark logo */
.front-logo-wrap {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

    .front-logo-wrap img {
        width: 34%;
        opacity: 0.45;
        mix-blend-mode: soft-light;
        filter: saturate(2.2) brightness(1.3);
        user-select: none;
        -webkit-user-drag: none;
    }

.card-back::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(120% 90% at 10% 0%, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.00) 55%), radial-gradient(110% 90% at 90% 100%, rgba(0,0,0,0.32) 0%, rgba(0,0,0,0.00) 55%), linear-gradient(to bottom, rgba(0,0,0,0.08), rgba(0,0,0,0.20));
}

/* BACK watermark logo */
.back-logo-wrap {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

    .back-logo-wrap img {
        width: 34%;
        opacity: 0.18;
        mix-blend-mode: soft-light;
        user-select: none;
        -webkit-user-drag: none;
    }

/* PRESIDENT / PIC NAME */
.card-back .director {
    left: 6%;
    top: 18%;
    width: 58%;
    font-size: var(--back-name-size);
    font-weight: 900;
    line-height: 1.14;
    letter-spacing: 0.012em;
    z-index: 3;
    text-shadow: 0 2px 10px rgba(0,0,0,.55);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ROLE – premium badge pill (gold edge, luxe feel) */
.card-back .role {
    left: 6%;
    top: 29%;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: var(--back-meta-size);
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 250, 235, 0.92);
    background: linear-gradient(180deg, rgba(0,0,0,0.22), rgba(0,0,0,0.42));
    border: 1px solid rgba(212, 168, 74, 0.55);
    box-shadow: 0 10px 22px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.06) inset;
}

/* CONTACT LINES – aligned, icon hint, professional spacing */
.card-back .phone,
.card-back .email {
    left: 6%;
    width: 60%;
    z-index: 3;
    font-size: var(--back-contact-size);
    font-weight: 600;
    letter-spacing: 0.01em;
    text-shadow: 0 2px 8px rgba(0,0,0,.55);
    opacity: 0.98;
    padding-left: 22px; /* room for icon */
}

/* vertical rhythm */
.card-back .phone {
    top: 43%;
}

.card-back .email {
    top: 50%;
}

    /* Subtle icons (safe, no extra markup) */
    .card-back .phone::before,
    .card-back .email::before {
        position: absolute;
        left: 0;
        top: 0;
        transform: translateY(1px);
        font-size: 0.95em;
        opacity: 0.85;
        text-shadow: 0 2px 8px rgba(0,0,0,.55);
    }

.card-back .phone::before {
    content: "☎";
}

.card-back .email::before {
    content: "✉";
}

/* Email trim */
.card-back .email {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* PHOTO – luxe frame, consistent (no background tint panel) */
.card-back .photo {
    position: absolute;
    right: 7%;
    top: 18%;
    width: 22%;
    aspect-ratio: 3 / 4;
    border-radius: var(--photo-radius);
    object-fit: cover;
    border: var(--photo-border);
    box-shadow: var(--photo-shadow), 0 0 0 1px rgba(255,255,255,0.06) inset;
    background: #fff;
    z-index: 4; /* above vignette + watermark */
}

/* Optional: micro highlight on photo edge */
.card-back .photo {
    outline: 1px solid rgba(255, 255, 255, 0.06);
    outline-offset: -6px;
}

.card-front .qrbox {
    position: absolute;
    right: 24px;
    bottom: 28px;
    width: var(--qr-size);
    height: var(--qr-size);
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
}

.qrbox--premium {
    width: 100%;
    height: 100%;
}

.qr-wrap {
    position: relative;
    width: 100%;
    height: 100%;
}

.qr-svg {
    width: 100%;
    height: 100%;
    border-radius: var(--qr-radius);
    overflow: hidden;
    background: none;
}

    .qr-svg svg {
        width: 100%;
        height: 100%;
        display: block;
    }

.qr-logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 26%;
    aspect-ratio: 1 / 1;
    border-radius: 999px;
    background: var(--qr-logo-bg);
    padding: 4px;
    box-shadow: var(--qr-logo-shadow);
    pointer-events: none;
}

    .qr-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
    }

.qr-caption {
    display: none;
}

.card-front .qrimg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.card-shell--lg .card-front .qrbox {
    width: 20%;
    height: auto;
}

.card-shell--lg .card-back .photo {
    width: 22%;
}

.card-shell--lg .qr-logo {
    width: 18%;
}

