/* ========================================
   TrustedSite Certification — Frontend Styles
   ======================================== */

/* ----------------------------------------
   Trustmark Badge
   ---------------------------------------- */
.trustedsite-trustmark {
    width: 120px;
    height: 50px;
    display: inline-block;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    border-radius: 6px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    vertical-align: middle;
}

.trustedsite-trustmark:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.trustedsite-trustmark:active {
    transform: translateY(0);
}

/* ----------------------------------------
   Overlay
   ---------------------------------------- */
#trustedsite-tm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

#trustedsite-tm-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* ----------------------------------------
   Modal Container
   ---------------------------------------- */
#trustedsite-tm-verify {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    z-index: 99999;
    width: 440px;
    max-width: 94vw;
    background: #ffffff;
    border-radius: 16px;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(0, 0, 0, 0.06);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    overflow: hidden;
}

#trustedsite-tm-verify.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* ----------------------------------------
   Modal Header
   ---------------------------------------- */
.ts-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eef0f2;
    background: #fafbfc;
}

.ts-modal-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1;
}

.ts-modal-shield {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.ts-modal-shield svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ----------------------------------------
   Close Button
   ---------------------------------------- */
#trustedsite-tm-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    color: #8b8fa3;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
    outline: none;
}

#trustedsite-tm-close:hover {
    background: #f0f0f5;
    color: #1a1a2e;
}

#trustedsite-tm-close:active {
    transform: scale(0.93);
    background: #e4e4eb;
}

#trustedsite-tm-close:focus-visible {
    outline: 2px solid #4f7df3;
    outline-offset: 2px;
}

/* Pure CSS X icon */
.ts-close-icon {
    position: relative;
    width: 18px;
    height: 18px;
    display: block;
}

.ts-close-icon::before,
.ts-close-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}

.ts-close-icon::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.ts-close-icon::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* ----------------------------------------
   Modal Body (iframe container)
   ---------------------------------------- */
.ts-modal-body {
    position: relative;
    height: 480px;
    background: #f5f5f7;
}

.ts-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Loading spinner */
.ts-modal-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f7;
    z-index: 1;
    transition: opacity 0.25s ease;
}

.ts-modal-spinner.hidden {
    opacity: 0;
    pointer-events: none;
}

.ts-spinner-ring {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e3eb;
    border-top-color: #4f7df3;
    border-radius: 50%;
    animation: tsc-spin 0.7s linear infinite;
}

@keyframes tsc-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ----------------------------------------
   Modal Footer
   ---------------------------------------- */
.ts-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #eef0f2;
    background: #fafbfc;
    text-align: center;
}

.ts-modal-footer-text {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1;
}

.ts-modal-footer-text a {
    color: #4f7df3;
    text-decoration: none;
    font-weight: 500;
}

.ts-modal-footer-text a:hover {
    text-decoration: underline;
}

/* ----------------------------------------
   Responsive
   ---------------------------------------- */
@media (max-width: 480px) {
    #trustedsite-tm-verify {
        width: 96vw;
        border-radius: 12px;
    }

    .ts-modal-body {
        height: 420px;
    }

    .ts-modal-header {
        padding: 12px 16px;
    }

    .ts-modal-brand {
        font-size: 14px;
    }

    .ts-modal-footer {
        padding: 10px 16px;
    }
}

/* ----------------------------------------
   Reduced motion
   ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    #trustedsite-tm-overlay,
    #trustedsite-tm-verify,
    .ts-modal-spinner {
        transition: none;
    }

    .ts-spinner-ring {
        animation: none;
    }

    .trustedsite-trustmark {
        transition: none;
    }
}
