* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* فونت‌های داخلی */
@font-face {
    font-family: 'Vazir';
    src: url('fonts/vazir.woff2') format('woff2');
    font-weight: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Nexstep';
    src: url('fonts/NEXSTEP.ttf') format('truetype');
    font-weight: normal;
    font-display: swap;
}

body {
    font-family: 'Vazir', 'Segoe UI', Tahoma, sans-serif;
    min-height: 100vh;
    background: #050508;
    overflow-x: hidden;
    position: relative;
    transition: all 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

/* حالت انگلیسی */
body.english-mode {
    font-family: 'Nexstep', 'Segoe UI', Tahoma, sans-serif;
    direction: ltr;
    text-align: left;
}

body.english-mode .container {
    direction: ltr;
}

body.english-mode .coming-soon,
body.english-mode .footer,
body.english-mode .form-title,
body.english-mode .gift-badge span {
    direction: ltr;
    text-align: center;
}

body.english-mode .input-group i {
    right: auto;
    left: 18px;
}

body.english-mode .input-group input {
    padding: 14px 20px 14px 50px;
    text-align: left;
    direction: ltr;
}

/* کانواس بکگراند */
#mainCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: block;
}

.container {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
}

/* ========== دکمه تغییر زبان ========== */
.lang-switch {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 100;
    display: flex;
    gap: 20px;
    background: transparent;
}

body.english-mode .lang-switch {
    right: auto;
    left: 25px;
}

.lang-btn {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn.active {
    color: #ffd700;
}

.lang-btn.active::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: #ffd700;
    margin-top: 4px;
}

.lang-btn:hover:not(.active) {
    color: rgba(255, 215, 0, 0.7);
}

/* ========== لوگو ========== */
.logo-image {
    max-width: 500px;
    width: 85%;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.2));
    transition: all 0.4s ease;
}

.logo-image:hover {
    transform: scale(1.02);
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.4));
}

.gold-line {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ffd700, #ffffff, #ffd700, transparent);
    margin: 10px auto 20px auto;
    animation: linePulse 2s ease-in-out infinite;
}

@keyframes linePulse {
    0%, 100% { width: 50px; opacity: 0.5; }
    50% { width: 80px; opacity: 1; }
}

.coming-soon {
    color: rgba(255, 215, 0, 0.8);
    letter-spacing: 6px;
    font-size: 13px;
    margin-bottom: 30px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

/* ========== تایمر ========== */
.countdown {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 35px;
    flex-wrap: wrap;
}

.countdown-box {
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.3));
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 15px 20px;
    min-width: 80px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    transition: all 0.3s ease;
}

.countdown-box:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.countdown-number {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #ffd700, #ffffff);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    font-family: monospace;
    letter-spacing: 2px;
}

.countdown-label {
    font-size: 11px;
    color: rgba(255, 215, 0, 0.7);
    margin-top: 8px;
    letter-spacing: 1px;
    font-weight: 500;
}

.title {
    color: white;
    font-size: 17px;
    margin-bottom: 25px;
}

.title span {
    color: #ffd700;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.stats {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border-radius: 60px;
    padding: 8px 25px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 215, 0, 0.15);
    transition: all 0.3s;
}

.stats:hover {
    border-color: rgba(255, 215, 0, 0.4);
    transform: scale(1.02);
}

.stats i {
    color: #ffd700;
    font-size: 18px;
}

.stats-number {
    color: #ffd700;
    font-weight: bold;
    font-size: 20px;
}

.stats-text {
    color: #ccc;
    font-size: 13px;
}

.form-card {
    background: rgba(15, 15, 25, 0.4);
    backdrop-filter: blur(20px);
    border-radius: 32px;
    padding: 32px;
    width: 100%;
    max-width: 450px;
    border: 1px solid rgba(255, 215, 0, 0.1);
    transition: all 0.4s ease;
}

.form-card:hover {
    border-color: rgba(255, 215, 0, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.form-title {
    color: rgba(255, 215, 0, 0.7);
    font-size: 12px;
    letter-spacing: 3px;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.gift-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 215, 0, 0.1);
    padding: 8px 22px;
    border-radius: 50px;
    color: #ffd700;
    font-size: 13px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.input-group {
    margin-bottom: 15px;
    position: relative;
}

.input-group i {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #ffd700;
    opacity: 0.6;
    font-size: 14px;
    transition: all 0.3s;
}

.input-group input {
    width: 100%;
    padding: 14px 50px 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 50px;
    color: white;
    font-size: 14px;
    transition: all 0.3s;
    font-family: 'Vazir', 'Segoe UI', Tahoma, sans-serif;
}

.input-group input:focus {
    outline: none;
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.05);
    transform: translateX(3px);
}

/* ========== شماره تلفن - همیشه چپ ========== */
.phone-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.phone-prefix {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 215, 0, 0.15);
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 13px;
    color: #ffd700;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
}

.ir-flag {
    width: 18px;
    height: 12px;
    background: linear-gradient(to bottom, #23920c 0%, #23920c 33%, #ffffff 33%, #ffffff 66%, #ef3340 66%, #ef3340 100%);
    border-radius: 2px;
    display: inline-block;
}

.phone-wrapper input {
    width: 100%;
    padding: 14px 18px 14px 115px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 50px;
    color: white;
    font-size: 14px;
    font-family: 'Vazir', 'Segoe UI', Tahoma, sans-serif;
}

.phone-wrapper input:focus {
    outline: none;
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.05);
}

button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(90deg, #ffd70020, #ffd70010);
    border: 1px solid #ffd70040;
    border-radius: 50px;
    color: #ffd700;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

button:hover {
    background: #ffd70020;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.2);
}

.footer {
    margin-top: 25px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
}

/* ========== پیام خطا ========== */
.error-msg {
    display: none;
    color: #ff6b6b;
    font-size: 12px;
    margin-top: 12px;
    padding: 10px 15px;
    border-radius: 50px;
    background: rgba(255, 107, 107, 0.1);
    text-align: center;
    direction: rtl;
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.error-msg.show {
    display: block;
    animation: fadeInUp 0.3s ease;
}

/* ========== لودینگ ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    visibility: visible;
    opacity: 1;
}

.loading-container {
    text-align: center;
}

.simple-loader {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 215, 0, 0.2);
    border-top: 3px solid #ffd700;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #ffd700;
    font-size: 13px;
    letter-spacing: 2px;
}

.success-msg {
    display: none;
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.1), rgba(74, 222, 128, 0.05));
    border: 1px solid #4ade80;
    border-radius: 50px;
    padding: 12px;
    margin-top: 20px;
    color: #4ade80;
    font-size: 13px;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* انیمیشن تغییر زبان */
.lang-transition {
    animation: langFlip 0.4s ease;
}

@keyframes langFlip {
    0% { opacity: 0; transform: scale(0.98) translateY(8px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ریسپانسیو */
@media (max-width: 500px) {
    .countdown-box {
        padding: 10px 14px;
        min-width: 65px;
    }
    .countdown-number {
        font-size: 22px;
    }
    .logo-image {
        max-width: 220px;
    }
    .form-card {
        padding: 20px;
    }
    .lang-switch {
        top: 15px;
        right: 15px;
        gap: 15px;
    }
    .lang-btn {
        font-size: 12px;
    }
    body.english-mode .lang-switch {
        left: 15px;
    }
}