@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Montserrat:wght@400;600;700;800&family=Noto+Naskh+Arabic:wght@400;600;700&family=Playfair+Display:wght@500;700&family=Poppins:wght@400;600;700&family=Reem+Kufi:wght@400;600;700&display=swap');

.brand-icon {
    width: 20px;
    height: 20px;
    display: block;
    fill: currentColor;
    flex: 0 0 auto;
}

.social-link.social-facebook:hover { background: #1877f2; }
.social-link.social-instagram:hover { background: #c13584; }
.social-link.social-linkedin:hover { background: #0a66c2; }
.social-link.social-x_twitter:hover { background: #111; }
.social-link.social-tiktok:hover { background: #111; }
.social-link.social-youtube:hover { background: #f00; }
.social-link.social-telegram:hover { background: #26a5e4; }

.company-social-links .brand-icon {
    width: 19px;
    height: 19px;
}

.nfc-designer {
    min-width: 0;
}

.nfc-designer-layout {
    display: grid;
    grid-template-columns: minmax(270px, 350px) minmax(0, 760px);
    gap: 28px;
    align-items: start;
}

.nfc-design-controls {
    position: sticky;
    top: 20px;
    display: grid;
    gap: 20px;
    padding: 22px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .07);
}

.nfc-design-controls fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.nfc-design-controls legend,
.nfc-design-controls .field > label {
    display: block;
    margin: 0 0 10px;
    color: #102a43;
    font-weight: 800;
}

.nfc-design-controls .field {
    margin: 0;
}

.nfc-segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 4px;
    border: 1px solid #d7e1ec;
    border-radius: 8px;
    background: #f3f6f9;
}

.nfc-segmented label {
    min-width: 0;
    cursor: pointer;
}

.nfc-segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.nfc-segmented span {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 6px;
    color: #475467;
    font-weight: 800;
}

.nfc-segmented svg {
    width: 17px;
    height: 17px;
}

.nfc-segmented input:checked + span {
    background: #fff;
    color: #102a43;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .12);
}

.nfc-color-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nfc-color-control input[type="color"] {
    width: 48px;
    height: 42px;
    padding: 3px;
    border: 1px solid #cfd9e5;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}

.nfc-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nfc-swatches button {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 3px solid #fff;
    border-radius: 50%;
    outline: 1px solid #cfd9e5;
    background: var(--swatch);
    cursor: pointer;
}

.nfc-swatches button:focus-visible {
    outline: 3px solid #84adff;
}

.nfc-checks {
    display: grid;
    gap: 9px;
}

.nfc-checks label {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #e0e7ef;
    border-radius: 6px;
    cursor: pointer;
}

.nfc-checks input {
    width: 18px;
    height: 18px;
    accent-color: #1456a0;
}

.nfc-checks span {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.nfc-download {
    width: 100%;
    min-height: 48px;
    border-radius: 7px;
}

.nfc-download[disabled] {
    opacity: .65;
    cursor: wait;
}

.nfc-spec {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #667085;
    font-size: 12px;
    font-weight: 700;
}

.nfc-spec svg {
    width: 15px;
    height: 15px;
}

.nfc-preview-stage {
    min-width: 0;
    width: 100%;
    max-width: 760px;
}

.nfc-preview-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 8px;
    color: #475467;
    font-size: 13px;
    font-weight: 800;
}

.nfc-preview-heading:not(:first-child) {
    margin-top: 22px;
}

.nfc-card-preview {
    --print-accent: #1456a0;
    position: relative;
    width: 100%;
    aspect-ratio: 86 / 55;
    overflow: hidden;
    padding: 28px 30px;
    border: 1px solid #d8e1ea;
    border-radius: 8px;
    background: #fff;
    color: #101828;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .14);
    font-family: var(--face-font, Inter, Arial, sans-serif);
}

.nfc-card-front { --face-font: Inter, Arial, sans-serif; --name-size: 24px; --title-size: 13px; --details-size: 10px; }
.nfc-card-rear { --face-font: Cairo, Tajawal, Arial, sans-serif; --name-size: 26px; --title-size: 14px; --details-size: 10px; }

.nfc-card-preview::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 8px;
    background: var(--print-accent);
}

.rtl .nfc-card-preview::before,
.nfc-card-rear::before {
    inset: 0 0 0 auto;
}

.nfc-card-preview.is-black {
    border-color: #2d333d;
    background: #080b10;
    color: #fff;
}

.nfc-card-top {
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nfc-card-company {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nfc-card-company img,
.nfc-company-fallback {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 6px;
    object-fit: contain;
    background: #fff;
}

.nfc-company-fallback {
    display: grid;
    place-items: center;
    color: #102a43;
    font-size: 20px;
    font-weight: 900;
}

.nfc-card-company strong {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.nfc-card-signal {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--print-accent);
    font-size: 13px;
    font-weight: 900;
}

.nfc-card-signal svg {
    width: 29px;
    height: 29px;
}

.nfc-card-body {
    height: calc(100% - 46px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 142px;
    gap: 24px;
    align-items: center;
}

.nfc-card-rear .nfc-card-body {
    grid-template-columns: 142px minmax(0, 1fr);
    direction: ltr;
}

.nfc-card-rear .nfc-card-identity {
    grid-column: 2;
    grid-row: 1;
}

.nfc-card-front .nfc-card-identity { text-align: left; direction: ltr; }
.nfc-card-rear .nfc-card-identity { text-align: right; direction: rtl; }
.nfc-card-rear .nfc-print-contact { text-align: right; }
.nfc-card-front .nfc-print-contact { text-align: left; }
.nfc-card-preview.is-ltr-face .nfc-print-contact { text-align:left; direction:ltr; }
.nfc-card-preview.is-rtl-face .nfc-print-contact { text-align:right; direction:rtl; }

.nfc-card-rear .nfc-card-qr {
    grid-column: 1;
    grid-row: 1;
}

.nfc-card-preview.is-ltr-face .nfc-card-body { direction:ltr; grid-template-columns:minmax(0,1fr) 142px; }
.nfc-card-preview.is-ltr-face .nfc-card-identity { grid-column:1; grid-row:1; text-align:left; direction:ltr; }
.nfc-card-preview.is-ltr-face .nfc-card-qr { grid-column:2; grid-row:1; }
.nfc-card-preview.is-rtl-face .nfc-card-body { direction:ltr; grid-template-columns:142px minmax(0,1fr); }
.nfc-card-preview.is-rtl-face .nfc-card-identity { grid-column:2; grid-row:1; text-align:right; direction:rtl; }
.nfc-card-preview.is-rtl-face .nfc-card-qr { grid-column:1; grid-row:1; }

.nfc-card-identity {
    min-width: 0;
    transform: translate(var(--text-x, 0), var(--text-y, 0));
    transition: transform .18s ease;
}

.nfc-card-kicker {
    display: block;
    margin-bottom: 7px;
    color: var(--print-accent);
    font-size: 10px;
    font-weight: 900;
}

.nfc-card-identity h2 {
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: inherit;
    font-size: var(--name-size);
    line-height: 1.2;
    letter-spacing: 0;
}

.nfc-card-identity > p {
    margin: 5px 0 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #667085;
    font-size: var(--title-size);
    font-weight: 700;
}

.nfc-card-preview.is-black .nfc-card-identity > p {
    color: #d0d5dd;
}

.nfc-print-contacts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 14px;
    row-gap: var(--contact-gap, 6px);
}

.nfc-print-contact {
    min-width: 0;
    position: relative;
    display: block;
    padding-inline-start: 26px;
}

.nfc-print-contact [data-contact-icon] { position:absolute; inset-inline-start:0; top:50%; width:18px; height:18px; padding:3px; transform:translateY(-50%); border-radius:50%; color:#fff; background:var(--icon-color, #1456a0); }
.nfc-card-preview.icons-hidden .nfc-print-contact { padding-inline-start:0; }
.nfc-print-contact[hidden] { display:none !important; }
.nfc-icon-color { margin-top:12px; }
.nfc-icon-color input[type="color"] { width:100%; height:42px; padding:3px; border:1px solid #d0d5dd; border-radius:9px; background:#fff; cursor:pointer; }

.nfc-print-contact span {
    display: block;
    margin-bottom: 1px;
    color: #98a2b3;
    font-size: 8px;
    font-weight: 700;
}

.nfc-print-contact strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--details-size);
}

.nfc-card-qr {
    width: 142px;
    display: grid;
    justify-items: center;
    gap: 0;
}

.nfc-card-qr img {
    width: 124px;
    height: 124px;
    padding: 7px;
    border-radius: 5px;
    background: #fff;
    object-fit: contain;
}

.nfc-qr-image-wrap { position:relative; display:block; width:124px; height:124px; }
.nfc-qr-center-logo { position:absolute; inset:50% auto auto 50%; width:28px; height:28px; padding:3px; transform:translate(-50%,-50%); border:2px solid #fff; border-radius:7px; background:#fff; box-shadow:0 1px 4px rgba(0,0,0,.18); }
.nfc-qr-center-logo img { width:100%; height:100%; padding:0; border-radius:4px; object-fit:contain; }

.nfc-type-grid, .nfc-size-groups { display:grid; grid-template-columns:1fr; gap:10px; }
.nfc-type-controls label { display:flex; flex-direction:column; align-items:stretch; gap:5px; color:#475467; font-size:12px; font-weight:700; }
.nfc-type-controls select { width:100%; min-height:38px; padding:7px 9px; border:1px solid #d0d5dd; border-radius:8px; background:#fff; }
.nfc-size-groups { margin-top:12px; }
.nfc-size-groups > div { padding:10px; border:1px solid #e4e7ec; border-radius:10px; }
.nfc-size-groups strong { display:block; margin-bottom:8px; }
.nfc-size-groups label { display:grid; grid-template-columns:minmax(105px,1fr) 105px 30px; align-items:center; gap:7px; margin-top:9px; }
.nfc-size-groups input[type="range"] { width:105px; }
.nfc-size-groups output { color:#0b2347; text-align:center; }

@media (max-width: 1380px) {
    .nfc-designer-layout {
        grid-template-columns: 1fr;
    }

    .nfc-design-controls {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nfc-design-controls .nfc-download,
    .nfc-design-controls .nfc-spec {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    .nfc-type-grid, .nfc-size-groups { grid-template-columns:1fr; }
    .nfc-design-controls {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .nfc-design-controls .nfc-download,
    .nfc-design-controls .nfc-spec {
        grid-column: auto;
    }

    .nfc-card-preview {
        padding: 15px 16px;
    }

    .nfc-card-top {
        height: 34px;
    }

    .nfc-card-company img,
    .nfc-company-fallback {
        width: 31px;
        height: 31px;
        flex-basis: 31px;
    }

    .nfc-card-company strong {
        max-width: 125px;
        font-size: 10px;
    }

    .nfc-card-signal span {
        display: none;
    }

    .nfc-card-signal svg {
        width: 23px;
        height: 23px;
    }

    .nfc-card-body,
    .nfc-card-rear .nfc-card-body {
        height: calc(100% - 34px);
        grid-template-columns: minmax(0, 1fr) 82px;
        gap: 10px;
    }

    .nfc-card-rear .nfc-card-body {
        grid-template-columns: 82px minmax(0, 1fr);
        direction: ltr;
    }

    .nfc-card-preview.is-ltr-face .nfc-card-body { grid-template-columns:minmax(0,1fr) 82px; }
    .nfc-card-preview.is-rtl-face .nfc-card-body { grid-template-columns:82px minmax(0,1fr); }

    .nfc-card-kicker {
        margin-bottom: 3px;
        font-size: 7px;
    }

    .nfc-card-identity h2 {
        font-size: 15px;
    }

    .nfc-card-identity > p {
        margin: 3px 0 6px;
        font-size: 9px;
    }

    .nfc-print-contacts {
        gap: 3px 7px;
    }

    .nfc-print-contact span {
        display: none;
    }

    .nfc-print-contact strong {
        font-size: 7px;
    }

    .nfc-card-qr {
        width: 82px;
        gap: 2px;
    }

    .nfc-card-qr img {
        width: 72px;
        height: 72px;
        padding: 4px;
    }

    .nfc-qr-image-wrap { width:72px; height:72px; }
    .nfc-qr-center-logo { width:20px; height:20px; padding:2px; border-radius:5px; }

    .nfc-card-qr span {
        font-size: 6px;
    }
}
