* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazirmatn', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(135deg, #1a2332 0%, #0f1419 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* =========================================
   ANIMATED PARTICLES BACKGROUND
   ========================================= */
.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(255, 140, 66, 0.4);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 140, 66, 0.6);
    animation: particleFloat 15s infinite ease-in-out;
}

.particle:nth-child(1) {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
    animation-duration: 18s;
}

.particle:nth-child(2) {
    top: 60%;
    left: 80%;
    animation-delay: 3s;
    animation-duration: 22s;
}

.particle:nth-child(3) {
    top: 80%;
    left: 30%;
    animation-delay: 6s;
    animation-duration: 20s;
}

.particle:nth-child(4) {
    top: 40%;
    left: 70%;
    animation-delay: 9s;
    animation-duration: 25s;
}

.particle:nth-child(5) {
    top: 10%;
    left: 50%;
    animation-delay: 12s;
    animation-duration: 16s;
}

@keyframes particleFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }

    25% {
        transform: translate(50px, -50px) scale(1.5);
        opacity: 0.8;
    }

    50% {
        transform: translate(-30px, 40px) scale(0.8);
        opacity: 0.5;
    }

    75% {
        transform: translate(40px, 30px) scale(1.2);
        opacity: 0.7;
    }
}

body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

body::before {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 140, 66, 0.15) 0%, transparent 70%);
    top: -10%;
    right: -10%;
    animation: float 25s ease-in-out infinite;
}

body::after {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(26, 35, 50, 0.5) 0%, transparent 70%);
    bottom: -10%;
    left: -10%;
    animation: float 20s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(30px, 30px) scale(1.1);
    }
}

/* =========================================
   LOGIN CONTAINER
   ========================================= */
.login-container {
    width: 100%;
    max-width: 440px;
    padding: 15px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.login-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    padding: 40px 32px 32px;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 140, 66, 0.5) 50%,
            transparent);
}

/* =========================================
   CORNER DECORATIONS
   ========================================= */
.corner-decoration {
    position: absolute;
    width: 80px;
    height: 80px;
    pointer-events: none;
    opacity: 0.15;
}

.corner-decoration.top-left {
    top: -15px;
    left: -15px;
    background:
        linear-gradient(to right, #ff8c42 2px, transparent 2px),
        linear-gradient(to bottom, #ff8c42 2px, transparent 2px);
    background-size: 15px 15px;
}

.corner-decoration.bottom-right {
    bottom: -15px;
    right: -15px;
    background:
        linear-gradient(to right, #ff8c42 2px, transparent 2px),
        linear-gradient(to bottom, #ff8c42 2px, transparent 2px);
    background-size: 15px 15px;
}

/* =========================================
   LOGO SECTION با Glow
   ========================================= */
.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 18px;
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 140, 66, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 3s ease-in-out infinite;
    z-index: 0;
}

@keyframes pulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.3;
    }
}

.logo-icon {
    position: relative;
    width: 75px;
    height: 75px;
    background: linear-gradient(135deg, #ff8c42 0%, #ff6b35 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow:
        0 15px 35px rgba(255, 140, 66, 0.4),
        inset 0 -2px 8px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    z-index: 1;
    transition: transform 0.3s ease;
}

.logo-icon:hover {
    transform: scale(1.05) rotate(5deg);
}

.logo-letter {
    font-size: 32px;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.logo-title {
    font-size: 28px;
    font-weight: 900;
    color: white;
    margin-bottom: 8px;
    text-shadow: 0 2px 20px rgba(255, 140, 66, 0.3);
    letter-spacing: -0.5px;
}

.logo-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.subtitle-icon {
    color: #ff8c42;
    font-size: 10px;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

/* =========================================
   STEP INDICATORS با انیمیشن
   ========================================= */
.step-indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.step-dot {
    position: relative;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.step-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    opacity: 0;
}

.step-dot.active {
    background: linear-gradient(135deg, #ff8c42 0%, #ff6b35 100%);
    width: 32px;
    border-radius: 6px;
    box-shadow: 0 0 15px rgba(255, 140, 66, 0.6);
}

.step-dot.active .step-pulse {
    animation: stepPulse 2s ease-out infinite;
}

@keyframes stepPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

.step-line {
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.1),
            rgba(255, 255, 255, 0.05));
    border-radius: 1px;
}

/* =========================================
   FORM HEADER
   ========================================= */
.form-header {
    margin-bottom: 25px;
}

.form-title {
    font-size: 22px;
    font-weight: 900;
    color: white;
    margin-bottom: 10px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.title-decoration {
    color: #ff8c42;
    font-size: 12px;
    opacity: 0.6;
    font-weight: 400;
}

.form-description {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
}

.highlight-text {
    color: #ff8c42;
    font-weight: 700;
    padding: 2px 8px;
    background: rgba(255, 140, 66, 0.15);
    border-radius: 6px;
    border: 1px solid rgba(255, 140, 66, 0.3);
}

/* =========================================
   LOGIN TABS با Shine Effect
   ========================================= */
.login-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-icon {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.tab-text {
    position: relative;
    z-index: 1;
}

.tab-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    transition: left 0.5s ease;
}

.tab-btn:hover .tab-shine {
    left: 100%;
}

.tab-btn.active {
    background: linear-gradient(135deg, #ff8c42 0%, #ff6b35 100%);
    color: white;
    border-color: transparent;
    box-shadow:
        0 8px 20px rgba(255, 140, 66, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.tab-btn.active .tab-icon {
    transform: scale(1.1);
}

/* =========================================
   FORM INPUTS با Border Glow
   ========================================= */
.form-group {
    margin-bottom: 20px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 16px;
    transition: all 0.3s ease;
    z-index: 2;
}

.form-control {
    width: 100%;
    height: 56px;
    padding: 12px 48px 12px 20px;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: #ffffff !important;
    font-size: 16px;
    text-align: right;
    letter-spacing: 1px;
    caret-color: #ff8c42;
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.form-control.otp-input {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 8px;
    padding: 12px 20px;
}

.input-border-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 14px;
    opacity: 0;
    background: linear-gradient(135deg, #ff8c42, #ff6b35);
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

.form-control:focus {
    outline: none;
    border-color: rgba(255, 140, 66, 0.6);
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow:
        0 0 0 4px rgba(255, 140, 66, 0.1),
        0 8px 20px rgba(255, 140, 66, 0.2);
}

.form-control:focus~.input-border-glow {
    opacity: 0.3;
    animation: borderGlow 2s ease-in-out infinite;
}

.form-control:focus~.input-icon {
    color: #ff8c42;
    transform: translateY(-50%) scale(1.1);
}

@keyframes borderGlow {

    0%,
    100% {
        opacity: 0.2;
    }

    50% {
        opacity: 0.4;
    }
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px rgba(255, 255, 255, 0.06) inset !important;
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
    border-radius: 14px;
}

/* =========================================
   SUBMIT BUTTON با Glow Effect
   ========================================= */
.btn-submit {
    width: 100%;
    height: 54px;
    background: linear-gradient(135deg, #ff8c42 0%, #ff6b35 100%);
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 10px 30px rgba(255, 140, 66, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.btn-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow:
        0 15px 40px rgba(255, 140, 66, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-submit:hover .btn-glow {
    width: 300px;
    height: 300px;
}

.btn-submit:active {
    transform: translateY(0);
    box-shadow:
        0 5px 15px rgba(255, 140, 66, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* =========================================
   TIMER BOX
   ========================================= */
.timer-box {
    margin-top: 20px;
    padding: 14px 20px;
    background: rgba(255, 140, 66, 0.08);
    border: 1px solid rgba(255, 140, 66, 0.2);
    border-radius: 12px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.timer-icon {
    color: #ff8c42;
    font-size: 16px;
    animation: tickTock 1s ease-in-out infinite;
}

@keyframes tickTock {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-10deg);
    }

    75% {
        transform: rotate(10deg);
    }
}

.timer-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
}

.timer-count {
    color: #ff8c42;
    font-weight: 800;
    font-size: 16px;
    padding: 2px 8px;
    background: rgba(255, 140, 66, 0.15);
    border-radius: 6px;
    min-width: 35px;
    display: inline-block;
}

/* =========================================
   BACK LINK
   ========================================= */
.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-btn {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.back-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    transition: width 0.3s ease;
    z-index: 0;
}

.back-btn:hover::before {
    width: 100%;
}

.back-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.back-btn i,
.back-btn span {
    position: relative;
    z-index: 1;
}

/* =========================================
   TERMS FOOTER (بخش جدید)
   ========================================= */
.terms-footer {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.terms-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.6;
    margin: 0;
}

.terms-link {
    color: #ff8c42;
    text-decoration: none;
    font-weight: 700;
    position: relative;
    padding: 2px 4px;
    transition: all 0.3s ease;
}

.terms-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #ff8c42, #ff6b35);
    transition: width 0.3s ease;
}

.terms-link:hover {
    color: #ff6b35;
}

.terms-link:hover::after {
    width: 100%;
}

/* =========================================
   ALERTS
   ========================================= */
.alert {
    background: rgba(255, 255, 255, 0.06);
    color: white;
    font-size: 13px;
    font-weight: 600;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border-right: 4px solid transparent;
    border-left: none;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.alert-success {
    border-right-color: #28a745;
    background: rgba(40, 167, 69, 0.15);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.alert-danger {
    border-right-color: #dc3545;
    background: rgba(220, 53, 69, 0.15);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.2);
}

.alert i {
    font-size: 18px;
}

/* =========================================
   UTILITY CLASSES
   ========================================= */
.hidden {
    display: none !important;
}

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */
@media screen and (max-width: 480px) {
    .login-card {
        padding: 32px 24px 28px;
        border-radius: 24px;
    }

    .logo-icon {
        width: 65px;
        height: 65px;
    }

    .logo-letter {
        font-size: 28px;
    }

    .logo-title {
        font-size: 24px;
    }

    .form-title {
        font-size: 20px;
    }

    .form-control {
        height: 52px;
        font-size: 15px;
    }

    .btn-submit {
        height: 50px;
        font-size: 15px;
    }
}

@media screen and (max-height: 700px) {
    body {
        justify-content: flex-start;
        padding-top: 20px;
        padding-bottom: 20px;
        overflow-y: auto;
    }

    .login-container {
        margin-top: 0;
        margin-bottom: 20px;
    }

    .login-card {
        padding: 28px 24px 24px;
    }

    .logo-wrapper {
        margin-bottom: 12px;
    }

    .logo-icon {
        width: 55px;
        height: 55px;
    }

    .logo-letter {
        font-size: 24px;
    }

    .logo-title {
        font-size: 22px;
        margin-bottom: 6px;
    }

    .logo-subtitle {
        font-size: 11px;
    }

    .step-indicators {
        margin-bottom: 20px;
    }

    .form-header {
        margin-bottom: 18px;
    }

    .particles-bg .particle {
        display: none;
    }
}

@media screen and (max-height: 600px) {
    .logo-subtitle {
        display: none;
    }

    .logo-glow {
        display: none;
    }

    .corner-decoration {
        display: none;
    }
}

/* =========================================
   ANIMATIONS برای بهبود تجربه کاربری
   ========================================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    animation: fadeInUp 0.6s ease-out;
}

/* =========================================
   ACCESSIBILITY & UX IMPROVEMENTS
   ========================================= */
*:focus-visible {
    outline: 2px solid #ff8c42;
    outline-offset: 2px;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

button:disabled:hover {
    transform: none;
}

/* =========================================
   SMOOTH TRANSITIONS
   ========================================= */
.login-card>* {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#methodStep,
#otpStep,
#emailOtpStep {
    animation: fadeInUp 0.4s ease-out;
}