/* ==============================================================================
   🔐 FREIGHTLENS DOCS - PASSWORD GATE STYLES (IQAX / APIFOX STYLE)
   ============================================================================== */

/* Prevent flashing documentation before authentication */
html:not(.fl-authenticated) body {
    overflow: hidden !important;
    background-color: #121319 !important;
}

html:not(.fl-authenticated) .md-header,
html:not(.fl-authenticated) .md-container,
html:not(.fl-authenticated) .md-footer,
html:not(.fl-authenticated) .md-banner,
html:not(.fl-authenticated) [data-md-component="header"],
html:not(.fl-authenticated) [data-md-component="main"] {
    display: none !important;
}

/* Hide password gate once authenticated */
html.fl-authenticated #fl-password-gate {
    display: none !important;
}

/* Password Gate Overlay (Full Screen) */
#fl-password-gate {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-color: #121319;
    background-image: 
        radial-gradient(circle at 50% 30%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.04) 0%, transparent 40%);
    z-index: 2147483647;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #ffffff;
    user-select: none;
    transition: opacity 0.25s ease-out;
}

#fl-password-gate.fl-fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Card Container */
.fl-gate-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 440px;
    width: 100%;
}

/* App Logo (Official FreightLens Lens) */
.fl-gate-logo {
    width: 76px;
    height: 76px;
    border-radius: 20px;
    background: #181924;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 14px 32px -6px rgba(0, 0, 0, 0.55), 0 0 24px rgba(99, 102, 241, 0.15);
    animation: fl-float 4s ease-in-out infinite;
    padding: 12px;
    box-sizing: border-box;
}

@keyframes fl-float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-4px); }
}

.fl-official-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

/* Title & Subtitle */
.fl-gate-title {
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 10px 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.fl-gate-subtitle {
    font-size: 14px;
    color: #94a3b8;
    margin: 0 0 28px 0;
    font-weight: 400;
    line-height: 1.5;
}

/* Form Container */
.fl-gate-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 380px;
}

/* Input Group */
.fl-input-group {
    position: relative;
    flex: 1;
}

.fl-gate-input {
    width: 100%;
    height: 44px;
    background-color: #1a1b24;
    border: 1px solid #2d303e;
    border-radius: 9px;
    padding: 0 42px 0 16px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
    font-family: inherit;
}

.fl-gate-input::placeholder {
    color: #606578;
}

.fl-gate-input:focus {
    border-color: #6366f1;
    background-color: #1f212e;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.fl-gate-input.fl-input-error {
    border-color: #ef4444 !important;
    background-color: #24191c !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}

/* Eye Toggle Icon Button */
.fl-eye-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #71778c;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s, background-color 0.15s;
}

.fl-eye-btn:hover {
    color: #e2e8f0;
    background-color: rgba(255, 255, 255, 0.05);
}

.fl-eye-btn svg {
    width: 18px;
    height: 18px;
}

/* View Button */
.fl-gate-btn {
    height: 44px;
    padding: 0 24px;
    background: #6366f1;
    color: #ffffff;
    border: none;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.18s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.fl-gate-btn:hover {
    background: #4f46e5;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.fl-gate-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

/* Error Notification */
.fl-gate-error {
    margin-top: 14px;
    font-size: 13px;
    color: #f87171;
    font-weight: 500;
    min-height: 20px;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.2s ease;
}

.fl-gate-error.fl-show {
    opacity: 1;
    transform: translateY(0);
}

/* Shake Animation */
.fl-shake {
    animation: fl-shake-anim 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes fl-shake-anim {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Footer (Built with FreightLens Docs) */
.fl-gate-footer {
    position: absolute;
    bottom: 28px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #555b70;
    font-size: 12.5px;
}

.fl-footer-logo {
    width: 16px;
    height: 16px;
    object-fit: contain;
    opacity: 0.85;
}

.fl-gate-footer svg {
    width: 14px;
    height: 14px;
    opacity: 0.8;
}

/* Official Logo in Docs Header and Nav */
.md-header__button.md-logo img,
.md-nav__button.md-logo img {
    height: 32px !important;
    width: auto !important;
    max-height: 32px !important;
    object-fit: contain !important;
}

/* In-Doc Header Lock Button (For easy re-locking / testing) */
.fl-nav-lock-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--md-default-fg-color--light, #757575);
    background: transparent;
    border: 1px solid var(--md-default-fg-color--lighter, rgba(120, 120, 120, 0.3));
    border-radius: 6px;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.2s ease;
}

.fl-nav-lock-btn:hover {
    color: #ef4444;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

.fl-nav-lock-btn svg {
    width: 14px;
    height: 14px;
}

@media (max-width: 600px) {
    .fl-gate-form {
        flex-direction: column;
        width: 100%;
    }
    .fl-input-group, .fl-gate-btn {
        width: 100%;
    }
}

