/* =========================================================
   RESET & BASE
   ========================================================= */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-dark);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

img {
    max-width: 100%;
    display: block;
}

.accent {
    color: var(--primary);
}


/* =========================================================
   PRELOADER
   ========================================================= */

#preloader {
    position: fixed;
    inset: 0;
    background: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-ring {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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


/* =========================================================
   NAVBAR
   ========================================================= */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 1000;

    transition: var(--transition-smooth);

    background: rgba(15, 23, 42, 0.8);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}


/* =========================================================
   NAV CONTAINER
   ========================================================= */

.nav-container {
    width: 100%;

    max-width: 1440px;

    margin: 0 auto;
    padding: 0 24px;

    height: 100%;

    display: flex;
    justify-content: space-between;
    align-items: center;

    min-width: 0;
}


/* =========================================================
   LOGO
   ========================================================= */

.logo {
    font-family: var(--font-heading);

    font-size: 1.375rem;

    font-weight: 800;

    color: var(--text-light);

    display: flex;
    align-items: center;

    gap: 8px;

    white-space: nowrap;

    flex-shrink: 0;
}


/* =========================================================
   LOGO BADGE
   ========================================================= */

.logo-badge {
    position: relative;

    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(37, 99, 235, 0.15);

    border-radius: var(--radius-sm);

    border: 1px solid rgba(37, 99, 235, 0.3);

    flex-shrink: 0;
}

.logo-badge-img {
    height: 32px;
    width: auto;

    object-fit: contain;
}

.logo-tool {
    position: absolute;

    width: 24px;
    height: 24px;

    color: var(--primary);

    stroke-width: 2.5;
}

.logo-tool.tool-1 {
    transform: rotate(-45deg);
    z-index: 2;
}

.logo-tool.tool-2 {
    transform: rotate(45deg);
    z-index: 1;
}


/* =========================================================
   NAVIGATION LINKS
   DESKTOP DEFAULTS
   ========================================================= */

.nav-links {
    display: flex;

    align-items: center;

    justify-content: flex-end;

    gap: 10px;

    flex-wrap: nowrap;

    flex-shrink: 1;

    min-width: 0;
}

.nav-links a {
    color: var(--text-light);

    font-weight: 500;

    font-size: 0.85rem;

    opacity: 0.8;

    white-space: nowrap;
}

.nav-links a:hover {
    opacity: 1;

    color: var(--primary);
}


/* =========================================================
   LOGIN
   ========================================================= */

.nav-login {
    color: var(--text-light) !important;

    opacity: 0.9 !important;

    padding: 8px 16px;

    border: 1px solid rgba(255, 255, 255, 0.2);

    border-radius: var(--radius-full);

    font-weight: 600;

    font-size: 0.85rem;

    white-space: nowrap;
}

.nav-login:hover {
    background: rgba(255, 255, 255, 0.1);

    border-color: var(--primary);

    opacity: 1 !important;
}


/* =========================================================
   PRIMARY CTA
   ========================================================= */

.nav-cta-primary {
    background: var(--primary);

    color: white !important;

    opacity: 1 !important;

    padding: 8px 18px;

    border-radius: var(--radius-full);

    font-weight: 600;

    font-size: 0.85rem;

    box-shadow: var(--shadow-glow);

    white-space: nowrap;
}

.nav-cta-primary:hover {
    background: var(--primary-hover);

    transform: translateY(-2px);
}


/* =========================================================
   SECONDARY CTA
   ========================================================= */

.nav-cta-secondary {
    background: transparent;

    color: var(--primary) !important;

    opacity: 1 !important;

    padding: 8px 16px;

    border: 2px solid var(--primary);

    border-radius: var(--radius-full);

    font-weight: 600;

    font-size: 0.85rem;

    white-space: nowrap;
}

.nav-cta-secondary:hover {
    background: rgba(37, 99, 235, 0.1);

    transform: translateY(-2px);
}


/* =========================================================
   CONTRACTS
   ========================================================= */

.nav-contracts {
    display: inline-flex;

    align-items: center;

    gap: 4px;

    color: var(--text-light) !important;

    opacity: 0.9 !important;

    padding: 6px 12px;

    background: linear-gradient(
        135deg,
        rgba(37, 99, 235, 0.15) 0%,
        rgba(16, 185, 129, 0.15) 100%
    );

    border: 1px solid rgba(37, 99, 235, 0.3);

    border-radius: var(--radius-full);

    font-weight: 600;

    font-size: 0.85rem;

    white-space: nowrap;

    transition: var(--transition-fast);
}

.nav-contracts:hover {
    background: linear-gradient(
        135deg,
        rgba(37, 99, 235, 0.25) 0%,
        rgba(16, 185, 129, 0.25) 100%
    );

    border-color: var(--primary);

    opacity: 1 !important;
}


/* =========================================================
   MOBILE MENU BUTTON
   ========================================================= */

.menu-toggle {
    display: none;

    background: none;

    border: none;

    color: var(--text-light);

    cursor: pointer;

    flex-shrink: 0;
}

.menu-toggle svg {
    width: 28px;
    height: 28px;
}


/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
    background: var(--bg-dark);

    color: var(--text-light);

    padding: 80px 24px 24px;

    margin-top: 100px;
}

.footer-container {
    max-width: var(--container-max);

    margin: 0 auto;

    display: grid;

    grid-template-columns: 2fr 1fr 1fr;

    gap: 48px;

    margin-bottom: 48px;
}

.footer-brand h3 {
    color: var(--text-light);

    font-size: 1.5rem;

    margin-bottom: 16px;
}

.footer-brand p {
    color: var(--text-muted);

    max-width: 300px;
}

.footer-links h4,
.footer-contact h4 {
    color: var(--text-light);

    font-size: 1rem;

    margin-bottom: 20px;

    font-family: var(--font-body);

    font-weight: 600;
}

.footer-links a {
    display: block;

    color: var(--text-muted);

    margin-bottom: 12px;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-contact p {
    color: var(--text-muted);

    margin-bottom: 8px;
}

.footer-bottom {
    max-width: var(--container-max);

    margin: 0 auto;

    padding-top: 24px;

    border-top: 1px solid var(--border-dark);

    text-align: center;

    color: var(--text-muted);

    font-size: 0.875rem;
}


/* =========================================================
   CUSTOM ALERT MODAL
   ========================================================= */

.custom-alert {
    position: fixed;

    top: 100px;

    left: 50%;

    transform: translateX(-50%) translateY(-150%);

    z-index: 10000;

    width: calc(100% - 40px);

    max-width: 500px;

    opacity: 0;

    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    pointer-events: none;
}

.custom-alert.active {
    transform: translateX(-50%) translateY(0);

    opacity: 1;

    pointer-events: all;
}

.alert-container {
    background: white;

    border-radius: var(--radius-lg);

    padding: 20px;

    display: flex;

    align-items: flex-start;

    gap: 16px;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);

    position: relative;

    overflow: hidden;
}

.alert-icon {
    flex-shrink: 0;

    width: 48px;
    height: 48px;

    border-radius: 50%;

    display: flex;

    align-items: center;
    justify-content: center;

    transition: var(--transition-smooth);
}

.alert-icon svg {
    width: 28px;
    height: 28px;

    color: white;
}

.alert-icon.success {
    background: linear-gradient(
        135deg,
        var(--secondary) 0%,
        #34D399 100%
    );
}

.alert-icon.error {
    background: linear-gradient(
        135deg,
        #EF4444 0%,
        #F87171 100%
    );
}

.alert-icon.warning {
    background: linear-gradient(
        135deg,
        #F59E0B 0%,
        #FBBF24 100%
    );
}

.alert-icon.info {
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        #3B82F6 100%
    );
}

.alert-content {
    flex: 1;

    padding-top: 4px;
}

.alert-content h3 {
    font-size: 1.063rem;

    color: var(--text-dark);

    margin-bottom: 6px;

    font-weight: 700;
}

.alert-content p {
    font-size: 0.938rem;

    color: var(--text-muted);

    line-height: 1.5;
}

.alert-close {
    flex-shrink: 0;

    width: 32px;
    height: 32px;

    background: var(--bg-light);

    border: none;

    border-radius: 50%;

    display: flex;

    align-items: center;
    justify-content: center;

    cursor: pointer;

    color: var(--text-muted);

    transition: var(--transition-fast);
}

.alert-close:hover {
    background: var(--border-light);

    color: var(--text-dark);
}

.alert-close svg {
    width: 18px;
    height: 18px;
}

.alert-progress {
    position: absolute;

    bottom: 0;
    left: 0;

    height: 4px;

    background: var(--primary);

    width: 100%;

    transform-origin: left;

    animation: progressShrink 4s linear forwards;
}

.alert-progress.success {
    background: var(--secondary);
}

.alert-progress.error {
    background: #EF4444;
}

.alert-progress.warning {
    background: #F59E0B;
}

.alert-progress.info {
    background: var(--primary);
}

@keyframes progressShrink {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}


/* =========================================================
   ALERT - MOBILE
   ========================================================= */

@media (max-width: 640px) {

    .custom-alert {
        top: 80px;

        width: calc(100% - 32px);
    }

    .alert-container {
        padding: 16px;

        gap: 12px;
    }

    .alert-icon {
        width: 40px;
        height: 40px;
    }

    .alert-icon svg {
        width: 24px;
        height: 24px;
    }

    .alert-content h3 {
        font-size: 1rem;
    }

    .alert-content p {
        font-size: 0.875rem;
    }
}


/* =========================================================
   MOBILE NAVIGATION
   max-width: 768px
   ========================================================= */

@media (max-width: 768px) {

    /* -------------------------
       NAV CONTAINER
       ------------------------- */

    .nav-container {
        width: 100%;

        height: 100%;

        display: flex;

        align-items: center;

        justify-content: space-between;

        padding: 0 24px;
    }


    /* -------------------------
       LOGO
       ------------------------- */

    .logo-badge-img {
        height: 28px;
    }

    .logo {
        gap: 8px;

        flex-shrink: 0;
    }

    .logo span {
        font-size: 1.1rem;
    }


    /* -------------------------
       HAMBURGER TOGGLE
       ------------------------- */

    .menu-toggle {
        display: flex;

        align-items: center;

        justify-content: center;

        width: 40px;

        height: 40px;

        margin-left: auto;

        padding: 0;

        background: none;

        border: none;

        color: var(--text-light);

        cursor: pointer;

        flex-shrink: 0;
    }

    .menu-toggle svg {
        width: 28px;

        height: 28px;
    }


    /* -------------------------
       MOBILE NAV LINKS
       ------------------------- */

    .nav-links {
        position: fixed;

        top: var(--nav-height);

        left: 0;

        width: 100%;

        display: flex;

        flex-direction: column;

        align-items: center;

        justify-content: flex-start;

        padding: 32px;

        gap: 24px;

        background: var(--bg-dark);

        transform: translateY(-150%);

        transition: var(--transition-smooth);

        border-bottom: 1px solid var(--border-dark);

        margin-left: 0;

        flex-shrink: 0;
    }

    .nav-links.active {
        transform: translateY(0);
    }


    /* -------------------------
       FOOTER
       ------------------------- */

    .footer-container {
        grid-template-columns: 1fr;

        gap: 32px;
    }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .logo-badge-img {
        height: 24px;
    }

    .logo {
        gap: 6px;
    }

    .logo span {
        font-size: 1.35rem;
    }

    .nav-container {
        padding: 0 16px;
    }

    .menu-toggle {
        width: 40px;

        height: 40px;
    }
}


/* =========================================================
   TABLET / SMALL DESKTOP
   769px - 1023px
   ========================================================= */

@media (min-width: 769px) and (max-width: 1023px) {

    .nav-container {
        padding: 0 18px;
    }

    .logo-badge-img {
        height: 32px;
    }

    .logo {
        gap: 6px;
    }

    .logo span {
        font-size: 1.05rem;
    }

    .nav-links {
        gap: 5px;

        margin-left: 10px;
    }

    .nav-links a {
        font-size: 0.68rem;
    }

    .nav-login {
        padding: 6px 9px;

        font-size: 0.68rem;
    }

    .nav-cta-primary {
        padding: 6px 10px;

        font-size: 0.68rem;
    }

    .nav-cta-secondary {
        padding: 6px 9px;

        font-size: 0.68rem;

        border-width: 1px;
    }

    .nav-contracts {
        padding: 5px 8px;

        font-size: 0.68rem;
    }
}


/* =========================================================
   NORMAL DESKTOP
   1024px - 1279px
   ========================================================= */

@media (min-width: 1024px) and (max-width: 1279px) {

    .nav-container {
        max-width: 1400px;

        padding: 0 24px;
    }

    .logo-badge-img {
        height: 36px;
    }

    .logo span {
        font-size: 1.15rem;
    }

    .nav-links {
        gap: 7px;

        margin-left: 16px;
    }

    .nav-links a {
        font-size: 0.85rem;
    }

    .nav-login {
        padding: 7px 11px;

        font-size: 0.74rem;
    }

    .nav-cta-primary {
        padding: 7px 12px;

        font-size: 0.80rem;
    }

    .nav-cta-secondary {
        padding: 7px 11px;

        font-size: 0.80rem;

        border-width: 1px;
    }

    .nav-contracts {
        padding: 6px 9px;

        font-size: 0.74rem;
    }
}


/* =========================================================
   LARGE DESKTOP
   1280px+
   ========================================================= */

@media (min-width: 1280px) {

    .nav-container {
        max-width: 1440px;

        padding: 0 32px;
    }

    .logo-badge-img {
        height: 40px;
    }

    .logo span {
        font-size: 1.375rem;
    }

    .nav-links {
        gap: 9px;

        margin-left: 24px;
    }

    .nav-links a {
        font-size: 0.90rem;
    }

    .nav-login {
        padding: 8px 14px;

        font-size: 0.85rem;
    }

    .nav-cta-primary {
        padding: 8px 16px;

        font-size: 0.82rem;
    }

    .nav-cta-secondary {
        padding: 8px 14px;

        font-size: 0.82rem;
    }

    .nav-contracts {
        padding: 6px 11px;

        font-size: 0.82rem;
    }
}


/* =========================================================
   VERY LARGE DESKTOP
   1500px+
   ========================================================= */

@media (min-width: 1500px) {

    .nav-container {
        max-width: 1600px;

        padding: 0 40px;
    }

    .nav-links {
        gap: 12px;

        margin-left: 30px;
    }

    .nav-links a {
        font-size: 0.85rem;
    }

    .nav-login {
        padding: 8px 16px;

        font-size: 0.85rem;
    }

    .nav-cta-primary {
        padding: 8px 18px;

        font-size: 0.85rem;
    }

    .nav-cta-secondary {
        padding: 8px 16px;

        font-size: 0.85rem;
    }

    .nav-contracts {
        padding: 6px 12px;

        font-size: 0.85rem;
    }
}