@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Kalam:wght@400;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* Main System Overrides */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
}

body.gate-locked {
    overflow: hidden;
}

.access-gate {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background:
        radial-gradient(circle at 20% 15%, rgba(16, 185, 129, 0.18), transparent 32rem),
        radial-gradient(circle at 80% 85%, rgba(163, 230, 53, 0.13), transparent 30rem),
        #020617;
}

.access-gate[hidden] {
    display: none !important;
}

.access-gate-card {
    width: min(100%, 28rem);
    padding: 2rem;
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 1.25rem;
    background: rgba(15, 23, 42, 0.96);
    box-shadow: 0 2rem 6rem rgba(0, 0, 0, 0.55);
}

.access-gate-mark {
    width: 3.25rem;
    height: 3.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    background: linear-gradient(135deg, #10b981, #a3e635);
    color: #020617;
    font-size: 1.35rem;
    box-shadow: 0 1rem 2rem rgba(16, 185, 129, 0.22);
}

.access-gate-kicker {
    margin-top: 1.25rem;
    color: #a3e635;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.access-gate-card h1 {
    margin-top: 0.4rem;
    color: #ffffff;
    font-size: clamp(1.75rem, 6vw, 2.35rem);
    font-weight: 900;
    line-height: 1;
}

.access-gate-copy {
    margin-top: 0.85rem;
    color: #cbd5e1;
    font-size: 0.94rem;
    line-height: 1.6;
}

.access-gate-card label {
    display: block;
    margin-top: 1.25rem;
    color: #e2e8f0;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.access-gate-card input {
    width: 100%;
    margin-top: 0.45rem;
    padding: 0.9rem 1rem;
    border: 1px solid #334155;
    border-radius: 0.85rem;
    background: #020617;
    color: #ffffff;
    font-size: 1.1rem;
    outline: none;
}

.access-gate-card input:focus {
    border-color: #a3e635;
    box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.16);
}

.access-gate-error {
    min-height: 1.25rem;
    margin-top: 0.55rem;
    color: #fca5a5;
    font-size: 0.82rem;
    font-weight: 700;
}

.access-gate-card button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    margin-top: 0.75rem;
    padding: 0.95rem 1rem;
    border: 0;
    border-radius: 0.85rem;
    background: #a3e635;
    color: #020617;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 180ms ease, filter 180ms ease;
}

.access-gate-card button:hover,
.access-gate-card button:focus-visible {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #0f172a; /* Slate 900 */
}
::-webkit-scrollbar-thumb {
    background: #1e293b; /* Slate 800 */
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #059669; /* Emerald 600 */
}

/* Flowchart Button styling */
.stage-btn {
    background-color: #020617; /* Slate 950 */
    border-color: #1e293b; /* Slate 800 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.stage-btn:hover {
    border-color: #10b981; /* Emerald 500 */
    transform: translateY(-2px);
}

.active-stage-btn {
    border-color: #10b981 !important; /* Emerald 500 */
    background: linear-gradient(135deg, #022c22 0%, #020617 100%) !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.active-stage-btn span:first-child {
    color: #a3e635 !important; /* Lime 400 */
}

/* Hologram Warning Light for Quarantine */
.quarantine-light {
    position: relative;
}
.quarantine-light::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 8px #ef4444;
    animation: quarantineBlink 1.2s infinite alternate;
}

@keyframes quarantineBlink {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Handwriting Note block */
.handwriting-note {
    font-family: 'Kalam', cursive;
    color: #a3e635; /* Lime 400 */
    line-height: 1.4;
}

/* Interactive Tabs styling */
.active-q-btn {
    background-color: #10b981;
    color: #020617;
    border-color: #10b981;
}

.active-doc-tab {
    background-color: #10b981;
    color: #020617;
    border-color: #10b981;
}

.standard-card img {
    transition: transform 240ms ease, filter 240ms ease;
}

.standard-card:hover img {
    transform: scale(1.035);
    filter: saturate(1.08);
}

.lang-toggle button {
    color: #94a3b8;
    background: #020617;
}

.lang-toggle button.active {
    color: #020617;
    background: #a3e635;
}

.gallery-thumb img {
    transition: transform 180ms ease, filter 180ms ease;
}

.gallery-thumb:hover img {
    transform: scale(1.04);
    filter: saturate(1.08);
}

/* Responsive hardening for phone and tablet use */
* {
    min-width: 0;
}

img,
video,
canvas {
    max-width: 100%;
}

.primary-nav-links {
    max-width: 100%;
}

.primary-nav-links > a {
    line-height: 1.2;
    white-space: normal;
}

.document-preview-card {
    overflow-wrap: anywhere;
}

@media (max-width: 1024px) {
    .top-nav-inner {
        flex-direction: column !important;
        align-items: stretch;
    }

    .top-nav-inner > div:first-child {
        width: 100%;
    }

    .primary-nav-links {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        justify-content: flex-start;
        overflow-x: visible;
        padding-bottom: 0;
        width: 100%;
    }

    .primary-nav-links > a,
    .primary-nav-links .lang-toggle {
        justify-content: center;
        text-align: center;
    }

    .hero-panel {
        align-items: stretch;
    }
}

@media (max-width: 767px) {
    .portal-alert {
        flex-wrap: wrap;
    }

    .site-main {
        padding-top: 1rem;
        padding-bottom: 1.5rem;
        row-gap: 2rem;
    }

    .top-nav-inner {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        gap: 0.75rem;
    }

    .top-nav-inner > div:first-child {
        align-items: flex-start;
        width: 100%;
    }

    .top-nav-inner .text-xl {
        font-size: 1rem;
        line-height: 1.2;
    }

    .primary-nav-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        font-size: 0.64rem;
        letter-spacing: 0.04em;
    }

    .primary-nav-links > a,
    .lang-toggle button {
        padding: 0.55rem 0.7rem;
    }

    .hero-panel,
    .responsive-section {
        border-radius: 1rem;
        padding: 1rem;
    }

    .hero-panel {
        gap: 1rem;
    }

    .hero-panel h1 {
        font-size: clamp(1.9rem, 8vw, 2.15rem);
        line-height: 0.95;
    }

    .hero-panel h1 > span {
        display: block;
        max-width: 10ch;
    }

    .hero-panel p,
    .responsive-section p {
        font-size: 0.82rem;
    }

    .quick-summary {
        padding: 1rem;
        border-radius: 1rem;
    }

    .quick-summary .flex {
        align-items: flex-start;
        gap: 0.75rem;
    }

    .quick-summary span[id] {
        white-space: nowrap;
    }

    .stage-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .stage-btn {
        padding: 0.85rem;
        border-radius: 0.9rem;
        min-height: auto;
    }

    .stage-btn span:first-child {
        font-size: 0.68rem;
    }

    .stage-btn span:nth-child(2) {
        font-size: 0.82rem;
        line-height: 1.25;
    }

    .flowchart-details {
        padding: 1rem;
        border-radius: 1rem;
    }

    .media-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mobile-stack,
    .mobile-stack-3 {
        grid-template-columns: 1fr !important;
    }

    #inspectionChecklist {
        grid-template-columns: 1fr;
    }

    #labelPreviewCard,
    #manifestPreviewCard,
    .document-preview-card {
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 0.85rem !important;
        font-size: 8px;
    }

    #manifestPreviewCard {
        width: max-content;
        min-width: 18rem !important;
    }

    #docPanelLabel .bg-slate-950,
    #docPanelManifest .bg-slate-950 {
        padding: 0.75rem;
    }

    .standard-card,
    .inspection-check {
        border-radius: 0.9rem;
    }
}

@media (max-width: 420px) {
    body {
        overflow-x: hidden;
    }

    .portal-alert {
        align-items: flex-start;
        font-size: 0.62rem;
        line-height: 1.25;
        letter-spacing: 0.05em;
    }

    .hero-panel h1 {
        font-size: clamp(1.75rem, 7.7vw, 2rem);
    }

    .responsive-section h2 {
        font-size: 1.25rem;
        line-height: 1.2;
    }

    .responsive-section h3 {
        line-height: 1.25;
    }

    .primary-nav-links {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
    }
}

.inspection-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid #1e293b;
    border-radius: 0.75rem;
    background: #020617;
    color: #cbd5e1;
    line-height: 1.35;
}

.inspection-check input {
    margin-top: 0.1rem;
    accent-color: #10b981;
}

.inspection-report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

.inspection-report-table th,
.inspection-report-table td {
    border: 1px solid #cbd5e1;
    padding: 6px;
    vertical-align: top;
}

.inspection-report-table th {
    background: #f1f5f9;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #334155;
}

/* PRINT OUT STYLES & OVERRIDES */
@media print {
    /* Hide everything on the standard screen layout */
    body * {
        visibility: hidden !important;
    }

    /* Target specific blocks we want to isolate for print */
    #printableLabelBlock, #printableLabelBlock * {
        visibility: visible !important;
    }
    #printableCoaBlock, #printableCoaBlock * {
        visibility: visible !important;
    }
    #printableManifestBlock, #printableManifestBlock * {
        visibility: visible !important;
    }
    #printableInspectionBlock, #printableInspectionBlock * {
        visibility: visible !important;
    }

    /* Label Print Configuration */
    #printableLabelBlock {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 0.25in;
        margin: 0;
        background-color: #ffffff !important;
        color: #000000 !important;
        display: block !important;
        box-shadow: none !important;
        border: none !important;
    }

    #printableLabelBlock .sticker-sheet {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.18in;
        width: 100%;
    }

    #printableLabelBlock .sticker-cell {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px dashed #94a3b8;
        padding: 0.08in;
    }

    #printableLabelBlock .codep-label {
        box-shadow: none !important;
    }

    /* Certificate of Analysis (COA) Print Configuration */
    #printableCoaBlock {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 0.5in;
        margin: 0;
        background-color: #ffffff !important;
        color: #000000 !important;
        display: block !important;
        box-shadow: none !important;
    }

    /* Transport Manifest Print Configuration */
    #printableManifestBlock {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 0.5in;
        margin: 0;
        background-color: #ffffff !important;
        color: #000000 !important;
        display: block !important;
        box-shadow: none !important;
    }

    /* Inspection Report Print Configuration */
    #printableInspectionBlock {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 0.5in;
        margin: 0;
        background-color: #ffffff !important;
        color: #000000 !important;
        display: block !important;
        box-shadow: none !important;
    }
}
