@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@600&family=Montserrat:ital,wght@0,400;0,500;0,600;0,700;0,800;1,500;1,600;1,700&display=swap');

#licenseId * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    user-select: none;
    text-transform: uppercase;
}

#licenseId.license-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.82);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9998;
    overflow-x: hidden;
    overflow-y: auto;
    pointer-events: none;
    cursor: default;
}

#licenseId.license-overlay.active {
    display: flex;
    pointer-events: auto;
    cursor: default;
}

#licenseId.license-overlay.active * {
    cursor: inherit;
}

#licenseId .page-nav-btn,
#licenseId .license-nav {
    cursor: pointer;
}

#licenseId .license-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    max-width: 92vw;
    transform: scale(0.92);
    pointer-events: auto;
    padding: 20px 0 30px;
}

@media (min-width: 1600px) {
    #licenseId .license-container {
        transform: scale(1);
    }
}

#licenseId .license-header-external {
    width: 100%;
    max-width: 850px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
    padding: 0 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#licenseId .doc-close-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.9;
}

#licenseId .hint-text {
    font-weight: 500;
    font-size: 14px;
    text-transform: none;
}

#licenseId .main-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: 1px;
}

#licenseId .icon-pass {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
}

#licenseId .license-card {
    position: relative;
    width: 850px;
    max-width: 92vw;
    height: 520px;
    background-color: #ffffff;
    border-radius: 32px;
    border: 10px solid #3a3a3a;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    opacity: 0;
    transform: scale(0.9);
}

@keyframes licOpen {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes licClose {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.9); }
}

#licenseId .license-card.anim-open {
    animation: licOpen 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.15) forwards;
}

#licenseId .license-card.anim-close {
    animation: licClose 0.2s ease-in forwards;
}

#licenseId .license-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 30px 40px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

#licenseId .license-page.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 5;
}

#licenseId .page-front {
    background-color: #d1d8ef;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0) 30%),
        radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 35%),
        radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 40%),
        linear-gradient(135deg, rgba(161, 196, 253, 0.85) 0%, rgba(232, 198, 230, 0.85) 50%, rgba(161, 196, 253, 0.85) 100%);
}

#licenseId .wm-coat {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    opacity: 0.06;
    background-image: url("img/coat_ua.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    pointer-events: none;
    z-index: 1;
}

#licenseId .lic-head {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

#licenseId .ua-badge {
    width: 70px;
    height: 44px;
    background-color: #283593;
    border: 2px solid #ffffff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    font-weight: 800;
    font-size: 22px;
    box-shadow: 0 0 0 1px #283593;
    flex-shrink: 0;
}

#licenseId .lic-header-text {
    display: flex;
    align-items: stretch;
    gap: 15px;
    color: #1a1a1a;
    flex: 1;
    margin-left: 20px;
    margin-right: 10px;
}

#licenseId .lic-header-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#licenseId .lic-header-col.left {
    text-align: right;
}

#licenseId .lic-header-col.right {
    text-align: left;
}

#licenseId .lic-header-col strong {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

#licenseId .lic-header-col span {
    font-size: 13px;
    font-weight: 600;
    color: #333333;
}

#licenseId .header-divider {
    width: 2px;
    background-color: #1a1a1a;
    margin: 2px 0;
    opacity: 0.8;
    flex-shrink: 0;
}

#licenseId .flag-badge {
    position: relative;
    width: 65px;
    height: 42px;
    background: linear-gradient(to bottom, #005bbb 50%, #ffd500 50%);
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

#licenseId .flag-badge::after {
    content: "UKR";
    position: absolute;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 800;
    font-size: 16px;
    mix-blend-mode: overlay;
}

#licenseId .lic-body {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 30px;
    flex: 1;
    height: calc(100% - 70px);
}

#licenseId .photo-block {
    width: 200px;
    height: 265px;
    background-color: #f2f2f2;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

#licenseId #license_photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#licenseId .photo-svg {
    width: 90px;
    height: 90px;
    fill: #cccccc;
}

#licenseId .lic-data {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-bottom: 5px;
    min-width: 0;
}

#licenseId .data-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

#licenseId .num {
    font-size: 14px;
    font-weight: 700;
    font-style: italic;
    color: #4a5b72;
    width: 25px;
    text-align: right;
    padding-top: 1px;
    flex-shrink: 0;
}

#licenseId .vals {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

#licenseId .val-ua {
    font-size: 19px;
    font-weight: 800;
    color: #111111;
    letter-spacing: 0.5px;
    line-height: 1.1;
    word-break: break-word;
}

#licenseId .val-en {
    font-size: 15px;
    font-weight: 600;
    color: #333333;
    line-height: 1.1;
    word-break: break-word;
}

#licenseId .data-row-split {
    display: flex;
    gap: 50px;
}

#licenseId .data-row-split .data-row {
    gap: 8px;
}

#licenseId .sign-font {
    font-family: 'Caveat', cursive;
    font-size: 38px;
    text-transform: none;
    color: #1a1a1a;
    transform: rotate(-3deg);
    margin-top: -15px;
    margin-bottom: -10px;
}

#licenseId .lic-footer-text {
    position: absolute;
    z-index: 2;
    bottom: 15px;
    right: 25px;
    font-size: 10px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.4);
    letter-spacing: 1px;
}

#licenseId .page-back {
    background: linear-gradient(to bottom, #dbeafe 0%, #eff6ff 50%, #dbeafe 100%);
    padding: 25px 35px;
}

#licenseId .back-container {
    display: flex;
    gap: 20px;
    height: 100%;
    position: relative;
    z-index: 2;
}

#licenseId .back-left {
    width: 190px;
    font-size: 10px;
    font-weight: 600;
    color: #222222;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    flex-shrink: 0;
}

#licenseId .back-left div {
    line-height: 1.1;
    text-transform: none;
}

#licenseId .back-left div strong {
    text-transform: uppercase;
}

#licenseId .back-right {
    flex: 1;
    display: flex;
    gap: 15px;
    align-items: stretch;
    min-width: 0;
}

#licenseId .real-cat-table {
    flex: 1;
    border-collapse: collapse;
    border: 1.5px solid #444444;
    background: rgba(255, 255, 255, 0.6);
    height: 100%;
}

#licenseId .real-cat-table th,
#licenseId .real-cat-table td {
    border: 1px solid #555555;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #111111;
    height: 28px;
}

#licenseId .real-cat-table th {
    font-size: 11px;
    height: 24px;
    background: rgba(0, 0, 0, 0.05);
}

#licenseId .real-cat-table td.col-9 {
    text-align: left;
    padding-left: 10px;
    font-size: 14px;
    font-weight: 800;
    width: 140px;
}

#licenseId .cat-svg {
    width: 24px;
    height: 24px;
    fill: #1a1a1a;
    margin-right: 5px;
    vertical-align: middle;
}

#licenseId .real-cat-table .col-date {
    width: 110px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

#licenseId .real-cat-table .col-restr {
    width: 60px;
    font-size: 13px;
}

#licenseId .real-cat-table tr.cat-active td {
    background: rgba(59, 102, 245, 0.08);
}

#licenseId .real-cat-table tr.cat-active .col-9 {
    color: #3b66f5;
}

#licenseId .vertical-barcode {
    width: 45px;
    height: 100%;
    background: repeating-linear-gradient(
        to right,
        #666666 0px, #666666 3px,
        transparent 3px, transparent 5px,
        #666666 5px, #666666 6px,
        transparent 6px, transparent 9px,
        #666666 9px, #666666 14px,
        transparent 14px, transparent 16px
    );
    border-radius: 2px;
    opacity: 0.8;
    flex-shrink: 0;
}

#licenseId .license-nav {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

#licenseId .page-nav-btn {
    min-width: 240px;
    padding: 14px 32px;
    border-radius: 14px;
    border: 1px solid #c8c8c8;
    background: linear-gradient(180deg, #ffffff 0%, #e6e6e6 100%);
    color: #3a3a3a;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    text-transform: none;
}

#licenseId .page-nav-btn:hover {
    background: linear-gradient(180deg, #ffffff 0%, #f0f0f0 100%);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.32);
}

#licenseId .page-nav-btn:active,
#licenseId .page-nav-btn.is-pressed {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

@media screen and (max-height: 600px) {
    #licenseId .license-container {
        transform: scale(0.85);
    }

    #licenseId .page-nav-btn {
        min-width: 200px;
        padding: 12px 24px;
        font-size: 14px;
    }
}
