@font-face {
    font-family: 'IranSans';
    /* مسیر فایل‌های فونت نسبت به فایل CSS */
    src: url('assets/fonts/IRANSansWeb.woff2') format('woff2'),
         url('assets/fonts/IRANSansWeb.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

:root {
    --primary-bg: #1A1A1A; /* 90% Black */
    --text-color: #e6edf3;
    --gold-color: #CFB53B;
    --glow-color: rgba(207, 181, 59, 0.6);
    --border-color: rgba(207, 181, 59, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'IranSans', Tahoma, Arial, sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-color);
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* --- New Animated Vertical Lines --- */
.animated-line {
    position: fixed;
    width: 2px;
    height: 100vh;
    background: linear-gradient(to top, transparent, var(--gold-color), transparent);
    animation: move-up 3s linear infinite;
    z-index: 1;
}
.line-left {
    left: 2%;
    animation-delay: -1.5s;
}
.line-right {
    right: 2%;
}
@keyframes move-up {
    from {
        transform: translateY(100vh);
    }
    to {
        transform: translateY(-100vh);
    }
}

/* --- Animated Wireframe Car Background --- */
#wireframe-car-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 1500px;
    z-index: -1;
    opacity: 0.4;
}

#wireframe-car-svg {
    width: 100%;
    height: auto;
    overflow: visible;
}

.car-path {
    fill: none;
    stroke: var(--gold-color);
    stroke-width: 0.75;
    stroke-dasharray: 200 3800;
    stroke-dashoffset: 0;
    animation: flow-line 8s linear infinite;
    filter: drop-shadow(0 0 10px var(--glow-color));
}

.car-path-2 {
    animation-delay: -4s;
}

@keyframes flow-line {
    from {
        stroke-dashoffset: 4000;
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* --- Header --- */
.page-header {
    width: 100%;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    top: 0;
    z-index: 10;
    animation: fadeIn 1.5s ease-out;
}

.main-logo a {
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
    z-index: 100;
}

.main-logo img {
    height: 125px;
    opacity: 0.91;
    display: block;
}

.main-logo .logo-enlarged {
    transform: scale(3);
}

.main-logo .logo-spinning {
    animation: quick-spin 0.5s ease-in-out forwards;
}

@keyframes quick-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.header-title {
    font-size: 2rem;
    font-weight: 500;
    color: var(--gold-color);
    text-shadow: 0 0 15px var(--glow-color);
    text-align: center;
}

.login-button {
    background: rgba(207, 181, 59, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 8px;
    text-decoration: none;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}
.login-button:hover {
    background: var(--gold-color);
    color: var(--primary-bg);
    border-color: var(--gold-color);
    box-shadow: 0 0 20px var(--glow-color);
}

/* --- Main Content (Frameless) --- */
.main-content {
    text-align: center;
    padding: 2.5rem;
    animation: fadeIn 1.5s ease-out 0.5s backwards;
    z-index: 5;
}

.brand-select-title {
    font-size: 1.2rem;
    color: rgba(230, 237, 243, 0.8);
    margin-bottom: 2.5rem;
}

.brands-container {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
    perspective: 1000px;
}

.brand-button {
    position: relative;
    width: 150px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(rgba(255,255,255,0.05), rgba(255,255,255,0));
    border: 1px solid var(--border-color);
    border-radius: 15px;
    text-decoration: none;
    color: var(--text-color);
    transform-style: preserve-3d;
    transition: all 0.4s ease;
    backdrop-filter: blur(2px);
}

.brand-button:hover {
    border-color: var(--gold-color);
    box-shadow: 0 0 30px var(--glow-color);
    transform: rotateY(var(--rotate-y, 0)) rotateX(var(--rotate-x, 0));
}

.brand-logo {
    height: 70px;
    max-width: 100px;
    margin-bottom: 15px;
    object-fit: contain;
    filter: grayscale(1) opacity(0.7);
    transition: all 0.4s ease;
}
.brand-button:hover .brand-logo {
    filter: none;
    transform: translateZ(20px);
}
.brand-name {
    font-size: 1rem;
    transform: translateZ(10px);
}

.page-footer {
    position: absolute;
    bottom: 15px;
    font-size: 0.8rem;
    color: rgba(230, 237, 243, 0.5);
    z-index: 10;
    animation: fadeIn 1.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Responsive Fixes --- */
@media (max-width: 768px) {
    body {
        justify-content: flex-start;
        padding: 20px 0;
        overflow-y: auto;
    }

    #wireframe-car-container, .animated-line {
        display: none; /* Hide complex animations for better performance */
    }

    .page-header {
        position: relative;
        flex-direction: column;
        gap: 20px;
        padding: 0 20px;
    }
    .header-title {
        font-size: 1.5rem;
        order: 1;
    }
    .main-logo {
        order: 2;
    }
    .login-button {
        order: 3;
        width: 100%;
        max-width: 300px;
        text-align: center;
    }

    .main-content {
        width: 90%;
        padding: 1.5rem 0;
        margin-top: 2rem;
    }

    .brand-select-title { font-size: 1rem; }

    .brands-container { 
        grid-template-columns: 1fr 1fr;
        display: grid;
        gap: 15px;
    }
    .brand-button { width: 100%; }
    
    .page-footer {
        position: relative;
        margin-top: 2rem;
    }
}
