/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   CSS VARIABLES (Minimal Luxury)
   ============================================ */
:root {
    /* Colors */
    --bg-primary: #FAFBFC;
    --teal-primary: #0F766E;
    --teal-dark: #0A5C55;
    --teal-light: #14B8A6;
    --text-primary: #1E293B;
    --text-secondary: #475569;
    --text-tertiary: #64748B;
    --border-light: rgba(15, 118, 110, 0.08);
    --white-pure: #FFFFFF;

    /* Typography */
    --font-regular: 'Vazir', sans-serif;
    --font-bold: 'Vazir-Bold', sans-serif;

    /* Sizes */
    --logo-size: clamp(120px, 18vw, 200px);
    --title-size: clamp(1.8rem, 4.5vw, 3rem);
    --progress-height: clamp(2px, 0.3vw, 3.5px);
    --progress-width: clamp(180px, 30vw, 380px);
    --text-size: clamp(0.9rem, 1.5vw, 1.05rem);

    /* Spacing */
    --gap-logo: clamp(1.5rem, 4vw, 3.5rem);
    --gap-title: clamp(0.8rem, 2vw, 1.5rem);
    --gap-progress: clamp(1.8rem, 3.5vw, 3rem);
    --gap-slogan: clamp(2.8rem, 5.5vw, 5rem);
}

/* ============================================
   FONTS (Local)
   ============================================ */
@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir-Bold';
    src: url('../fonts/Vazir-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ============================================
   BODY (White · Minimal)
   ============================================ */
html,
body {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg-primary);
    font-family: var(--font-regular);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 2rem;
    overflow: hidden;
    color: var(--text-primary);
}

/* ============================================
   MAIN WRAPPER
   ============================================ */
.loading-wrapper {
    width: 100%;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0;
    opacity: 0;
    animation: fadeIn 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    padding: 0.5rem 0;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(12px) scale(0.99);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   LOGO (Very Subtle)
   ============================================ */
.logo-wrapper {
    line-height: 0;
    margin-bottom: var(--gap-logo);
    opacity: 0;
    animation: logoReveal 2.2s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}

@keyframes logoReveal {
    0% {
        opacity: 0;
        transform: scale(0.92);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.logo-wrapper img {
    display: block;
    width: var(--logo-size);
    height: auto;
    margin: 0 auto;
    filter: drop-shadow(0 8px 32px rgba(15, 118, 110, 0.06));
    user-select: none;
    -webkit-user-drag: none;
}

/* ============================================
   BRAND TITLE (Elegant)
   ============================================ */
.brand-title {
    font-family: var(--font-bold);
    font-size: var(--title-size);
    font-weight: 700;
    color: var(--teal-primary);
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin-bottom: var(--gap-progress);
    opacity: 0;
    animation: titleReveal 1.6s cubic-bezier(0.22, 1, 0.36, 1) 0.4s forwards;
    text-shadow: 0 2px 20px rgba(15, 118, 110, 0.04);
}

@keyframes titleReveal {
    0% {
        opacity: 0;
        transform: translateY(4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   PROGRESS BAR (Classic · Modern · Minimal)
   ============================================ */
.progress-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    opacity: 0;
    animation: progressReveal 1.6s cubic-bezier(0.22, 1, 0.36, 1) 0.6s forwards;
}

@keyframes progressReveal {
    0% {
        opacity: 0;
        transform: translateY(4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.progress-track {
    width: var(--progress-width);
    max-width: 90%;
    height: var(--progress-height);
    background: var(--border-light);
    border-radius: 100px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--teal-primary), var(--teal-light));
    border-radius: 100px;
    transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

/* Shimmer effect on progress bar */
.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.25),
        transparent
    );
    transform: translateX(-100%);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ============================================
   SLOGAN (Bottom · Bold & Visible)
   ============================================ */
.slogan {
    font-family: var(--font-bold);
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-top: var(--gap-slogan);
    padding-top: var(--gap-progress);
    border-top: 1px solid var(--border-light);
    width: 100%;
    max-width: 340px;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

/* ============================================
   RESPONSIVE (Precise)
   ============================================ */

/* Mobile */
@media (max-width: 480px) {
    :root {
        --logo-size: 110px;
        --title-size: 1.6rem;
        --progress-height: 2.5px;
        --progress-width: 160px;
        --gap-logo: 1.2rem;
        --gap-progress: 1.2rem;
        --gap-slogan: 2.2rem;
    }

    .loading-wrapper {
        max-width: 400px;
    }

    .slogan {
        max-width: 260px;
        font-size: 0.9rem;
    }
}

/* Tablet */
@media (min-width: 481px) and (max-width: 768px) {
    :root {
        --logo-size: 140px;
        --title-size: 2.2rem;
        --progress-width: 260px;
        --gap-logo: 2rem;
        --gap-slogan: 3.2rem;
    }

    .loading-wrapper {
        max-width: 480px;
    }

    .slogan {
        max-width: 300px;
        font-size: 1.05rem;
    }
}

/* Desktop */
@media (min-width: 769px) {
    :root {
        --logo-size: 180px;
        --title-size: 2.8rem;
        --progress-width: 340px;
        --gap-logo: 3rem;
        --gap-slogan: 4.2rem;
    }

    .loading-wrapper {
        max-width: 600px;
    }

    .slogan {
        max-width: 360px;
        font-size: 1.15rem;
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    :root {
        --logo-size: 200px;
        --title-size: 3.2rem;
        --progress-width: 380px;
        --gap-logo: 3.5rem;
        --gap-slogan: 4.8rem;
    }

    .loading-wrapper {
        max-width: 680px;
    }

    .slogan {
        max-width: 400px;
        font-size: 1.25rem;
    }
}

/* Landscape on mobile */
@media (max-height: 600px) and (orientation: landscape) {
    :root {
        --logo-size: 75px;
        --title-size: 1.3rem;
        --progress-width: 140px;
        --progress-height: 2px;
        --gap-logo: 0.6rem;
        --gap-progress: 0.6rem;
        --gap-slogan: 1rem;
    }

    .loading-wrapper {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        max-width: 90vw;
        gap: 0.2rem 1.2rem;
    }

    .logo-wrapper {
        margin-bottom: 0;
        flex: 0 0 auto;
    }

    .brand-title {
        margin-bottom: 0;
        flex: 1 1 auto;
        min-width: 150px;
        font-size: 1.2rem;
    }

    .progress-wrapper {
        flex: 0 0 100%;
    }

    .slogan {
        margin-top: 0.3rem;
        padding-top: 0.3rem;
        font-size: 0.75rem;
        border-top: none;
        flex: 0 0 100%;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
::selection {
    background: rgba(15, 118, 110, 0.08);
    color: var(--teal-primary);
}

::-webkit-scrollbar {
    display: none;
}

body {
    scrollbar-width: none;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .logo-wrapper,
    .brand-title,
    .progress-wrapper {
        opacity: 1 !important;
        transform: none !important;
    }

    .progress-bar::after {
        animation: none !important;
    }
}