* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 50%, #0A3D91 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* ذرات متحرک پس‌زمینه */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

body::before {
    width: 500px;
    height: 500px;
    top: -200px;
    right: -150px;
    animation: float 20s ease-in-out infinite;
}

body::after {
    width: 400px;
    height: 400px;
    bottom: -150px;
    left: -100px;
    animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(30px, -30px) scale(1.05);
    }
}

.login-wrapper {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 2;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    background: #fff;
    border-radius: 24px;
    padding: 40px 32px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
}

.login-logo {
    width: 88px;
    height: 88px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #1976D2 0%, #42A5F5 100%);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 32px rgba(25, 118, 210, 0.4);
    animation: logoPop 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes logoPop {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

.login-logo .material-icons-round {
    font-size: 48px;
    color: #fff;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    color: #0D47A1;
    margin-bottom: 6px;
}

.login-subtitle {
    text-align: center;
    color: #78909C;
    font-size: 14px;
    margin-bottom: 24px;
}

.step-indicator {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
}

.step-dot {
    width: 32px;
    height: 5px;
    background: #E0E0E0;
    border-radius: 3px;
    transition: all 0.3s;
}

.step-dot.active {
    background: #1976D2;
    width: 48px;
    box-shadow: 0 0 12px rgba(25, 118, 210, 0.4);
}

/* هشدار */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: shake 0.4s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-6px);
    }

    75% {
        transform: translateX(6px);
    }
}

.alert-error {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #FFCDD2;
}

.alert-error .material-icons-round {
    font-size: 20px;
    flex-shrink: 0;
}

/* فرم */
.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #37474F;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    right: 14px;
    color: #90A4AE;
    font-size: 22px;
    pointer-events: none;
    transition: color 0.3s;
}

.form-input {
    width: 100%;
    padding: 14px 46px 14px 16px;
    border: 2px solid #E0E0E0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    color: #263238;
    background: #FAFAFA;
    transition: all 0.25s;
    outline: none;
}

.form-input:focus {
    border-color: #1976D2;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(25, 118, 210, 0.12);
}

.input-wrapper:focus-within .input-icon {
    color: #1976D2;
}

.form-input.code-input {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 14px;
    text-align: center;
    direction: ltr;
    padding: 16px;
    font-family: 'Courier New', monospace;
}

.code-input-wrapper .input-icon {
    display: none;
}

.form-hint {
    display: block;
    font-size: 12px;
    color: #78909C;
    margin-top: 6px;
    line-height: 1.6;
}

.form-hint a {
    color: #1976D2;
    text-decoration: none;
    font-weight: 600;
}

.form-hint a:hover {
    text-decoration: underline;
}

/* دکمه‌ها */
.btn-primary,
.btn-ghost,
.btn-warning {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(25, 118, 210, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(25, 118, 210, 0.45);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    background: transparent;
    color: #546E7A;
    margin-top: 12px;
    border: 2px solid #ECEFF1;
}

.btn-ghost:hover {
    background: #ECEFF1;
    color: #263238;
}

.btn-warning {
    background: linear-gradient(135deg, #F57C00 0%, #E65100 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(245, 124, 0, 0.35);
    margin-top: 12px;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(245, 124, 0, 0.45);
}

/* جعبه اضطراری */
.emergency-box {
    margin-top: 20px;
    padding: 20px;
    background: #FFF3E0;
    border-radius: 14px;
    border: 2px dashed #FFB74D;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }

    to {
        opacity: 1;
        max-height: 500px;
    }
}

.emergency-hint {
    font-size: 12px;
    color: #E65100;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    font-weight: 500;
}

.emergency-hint .material-icons-round {
    font-size: 18px;
}

/* فوتر */
.login-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    margin-top: 24px;
}

/* ریسپانسیو */
@media (max-width: 480px) {
    .login-card {
        padding: 32px 22px;
        border-radius: 20px;
    }

    .login-logo {
        width: 72px;
        height: 72px;
        border-radius: 20px;
    }

    .login-logo .material-icons-round {
        font-size: 40px;
    }

    .login-title {
        font-size: 20px;
    }

    .form-input {
        font-size: 14px;
        padding: 12px 42px 12px 14px;
    }

    .form-input.code-input {
        font-size: 24px;
        letter-spacing: 10px;
    }

    .btn-primary,
    .btn-ghost,
    .btn-warning {
        padding: 13px 18px;
        font-size: 14px;
    }
}